зеркало из https://github.com/microsoft/git.git
Merge branch 'nd/attr-pathspec-fix' into maint
"git add ':(attr:foo)'" is not supported and is supposed to be rejected while the command line arguments are parsed, but we fail to reject such a command line upfront. * nd/attr-pathspec-fix: add: do not accept pathspec magic 'attr'
This commit is contained in:
Коммит
ca211f9c9d
|
@ -454,7 +454,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
|
||||||
* Check the "pathspec '%s' did not match any files" block
|
* Check the "pathspec '%s' did not match any files" block
|
||||||
* below before enabling new magic.
|
* below before enabling new magic.
|
||||||
*/
|
*/
|
||||||
parse_pathspec(&pathspec, 0,
|
parse_pathspec(&pathspec, PATHSPEC_ATTR,
|
||||||
PATHSPEC_PREFER_FULL |
|
PATHSPEC_PREFER_FULL |
|
||||||
PATHSPEC_SYMLINK_LEADING_PATH,
|
PATHSPEC_SYMLINK_LEADING_PATH,
|
||||||
prefix, argv);
|
prefix, argv);
|
||||||
|
|
|
@ -166,7 +166,7 @@ test_expect_success 'fail if attr magic is used places not implemented' '
|
||||||
# though, but git-add is convenient as it has its own internal pathspec
|
# though, but git-add is convenient as it has its own internal pathspec
|
||||||
# parsing.
|
# parsing.
|
||||||
test_must_fail git add ":(attr:labelB)" 2>actual &&
|
test_must_fail git add ":(attr:labelB)" 2>actual &&
|
||||||
test_i18ngrep "unsupported magic" actual
|
test_i18ngrep "magic not supported" actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'abort on giving invalid label on the command line' '
|
test_expect_success 'abort on giving invalid label on the command line' '
|
||||||
|
|
Загрузка…
Ссылка в новой задаче