Skip to content

Commit faadedb

Browse files
committed
Merge branch 'nd/attr-pathspec-fix'
"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'
2 parents 5b39d49 + 84d938b commit faadedb

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

builtin/add.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ int cmd_add(int argc, const char **argv, const char *prefix)
454454
* Check the "pathspec '%s' did not match any files" block
455455
* below before enabling new magic.
456456
*/
457-
parse_pathspec(&pathspec, 0,
457+
parse_pathspec(&pathspec, PATHSPEC_ATTR,
458458
PATHSPEC_PREFER_FULL |
459459
PATHSPEC_SYMLINK_LEADING_PATH,
460460
prefix, argv);

t/t6135-pathspec-with-attrs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ test_expect_success 'fail if attr magic is used places not implemented' '
166166
# though, but git-add is convenient as it has its own internal pathspec
167167
# parsing.
168168
test_must_fail git add ":(attr:labelB)" 2>actual &&
169-
test_i18ngrep "unsupported magic" actual
169+
test_i18ngrep "magic not supported" actual
170170
'
171171

172172
test_expect_success 'abort on giving invalid label on the command line' '

0 commit comments

Comments
 (0)