mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
Merge branch 'en/sparse-checkout-eoo'
"git sparse-checkout (add|set) --[no-]cone --end-of-options" did not handle "--end-of-options" correctly after a recent update. * en/sparse-checkout-eoo: sparse-checkout: be consistent with end of options markers
This commit is contained in:
commit
d73db002b5
|
@ -773,8 +773,7 @@ static int sparse_checkout_add(int argc, const char **argv, const char *prefix)
|
||||||
|
|
||||||
argc = parse_options(argc, argv, prefix,
|
argc = parse_options(argc, argv, prefix,
|
||||||
builtin_sparse_checkout_add_options,
|
builtin_sparse_checkout_add_options,
|
||||||
builtin_sparse_checkout_add_usage,
|
builtin_sparse_checkout_add_usage, 0);
|
||||||
PARSE_OPT_KEEP_UNKNOWN_OPT);
|
|
||||||
|
|
||||||
sanitize_paths(argc, argv, prefix, add_opts.skip_checks);
|
sanitize_paths(argc, argv, prefix, add_opts.skip_checks);
|
||||||
|
|
||||||
|
@ -820,8 +819,7 @@ static int sparse_checkout_set(int argc, const char **argv, const char *prefix)
|
||||||
|
|
||||||
argc = parse_options(argc, argv, prefix,
|
argc = parse_options(argc, argv, prefix,
|
||||||
builtin_sparse_checkout_set_options,
|
builtin_sparse_checkout_set_options,
|
||||||
builtin_sparse_checkout_set_usage,
|
builtin_sparse_checkout_set_usage, 0);
|
||||||
PARSE_OPT_KEEP_UNKNOWN_OPT);
|
|
||||||
|
|
||||||
if (update_modes(&set_opts.cone_mode, &set_opts.sparse_index))
|
if (update_modes(&set_opts.cone_mode, &set_opts.sparse_index))
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -992,8 +990,7 @@ static int sparse_checkout_check_rules(int argc, const char **argv, const char *
|
||||||
|
|
||||||
argc = parse_options(argc, argv, prefix,
|
argc = parse_options(argc, argv, prefix,
|
||||||
builtin_sparse_checkout_check_rules_options,
|
builtin_sparse_checkout_check_rules_options,
|
||||||
builtin_sparse_checkout_check_rules_usage,
|
builtin_sparse_checkout_check_rules_usage, 0);
|
||||||
PARSE_OPT_KEEP_UNKNOWN_OPT);
|
|
||||||
|
|
||||||
if (check_rules_opts.rules_file && check_rules_opts.cone_mode < 0)
|
if (check_rules_opts.rules_file && check_rules_opts.cone_mode < 0)
|
||||||
check_rules_opts.cone_mode = 1;
|
check_rules_opts.cone_mode = 1;
|
||||||
|
|
|
@ -334,7 +334,7 @@ test_expect_success 'cone mode: set with nested folders' '
|
||||||
|
|
||||||
test_expect_success 'cone mode: add independent path' '
|
test_expect_success 'cone mode: add independent path' '
|
||||||
git -C repo sparse-checkout set deep/deeper1 &&
|
git -C repo sparse-checkout set deep/deeper1 &&
|
||||||
git -C repo sparse-checkout add folder1 &&
|
git -C repo sparse-checkout add --end-of-options folder1 &&
|
||||||
cat >expect <<-\EOF &&
|
cat >expect <<-\EOF &&
|
||||||
/*
|
/*
|
||||||
!/*/
|
!/*/
|
||||||
|
@ -886,6 +886,12 @@ test_expect_success 'by default, cone mode will error out when passed files' '
|
||||||
grep ".gitignore.*is not a directory" error
|
grep ".gitignore.*is not a directory" error
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'error on mistyped command line options' '
|
||||||
|
test_must_fail git -C repo sparse-checkout add --sikp-checks .gitignore 2>error &&
|
||||||
|
|
||||||
|
grep "unknown option.*sikp-checks" error
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'by default, non-cone mode will warn on individual files' '
|
test_expect_success 'by default, non-cone mode will warn on individual files' '
|
||||||
git -C repo sparse-checkout reapply --no-cone &&
|
git -C repo sparse-checkout reapply --no-cone &&
|
||||||
git -C repo sparse-checkout add .gitignore 2>warning &&
|
git -C repo sparse-checkout add .gitignore 2>warning &&
|
||||||
|
|
Loading…
Reference in a new issue