summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-11-21 13:57:45 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-21 13:57:45 (GMT)
commitca211f9c9d1118060ecaa8073654af9f1e2f5258 (patch)
tree5bc0e5f04a40588784367f70f9ad0a48c3e8275c
parentb4eafbcdb84fc406bff37f06fdf6310aca7d0249 (diff)
parent84d938b732242e81ec68647994070eb7c34d061f (diff)
downloadgit-ca211f9c9d1118060ecaa8073654af9f1e2f5258.zip
git-ca211f9c9d1118060ecaa8073654af9f1e2f5258.tar.gz
git-ca211f9c9d1118060ecaa8073654af9f1e2f5258.tar.bz2
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'
-rw-r--r--builtin/add.c2
-rwxr-xr-xt/t6135-pathspec-with-attrs.sh2
2 files changed, 2 insertions, 2 deletions
diff --git a/builtin/add.c b/builtin/add.c
index 9916498..0b64bcd 100644
--- a/builtin/add.c
+++ b/builtin/add.c
@@ -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
* below before enabling new magic.
*/
- parse_pathspec(&pathspec, 0,
+ parse_pathspec(&pathspec, PATHSPEC_ATTR,
PATHSPEC_PREFER_FULL |
PATHSPEC_SYMLINK_LEADING_PATH,
prefix, argv);
diff --git a/t/t6135-pathspec-with-attrs.sh b/t/t6135-pathspec-with-attrs.sh
index 77b8cef..e436a73 100755
--- a/t/t6135-pathspec-with-attrs.sh
+++ b/t/t6135-pathspec-with-attrs.sh
@@ -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
# parsing.
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' '