]> git.ipfire.org Git - thirdparty/git.git/commit - builtin/add.c
add: do not accept pathspec magic 'attr'
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Tue, 18 Sep 2018 17:31:59 +0000 (19:31 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Sep 2018 16:17:02 +0000 (09:17 -0700)
commit84d938b732242e81ec68647994070eb7c34d061f
tree2179095e9c8dcf8872129f962dd4a15204005693
parentd33c87517a85f544159b2efa406136dde18a5b9f
add: do not accept pathspec magic 'attr'

Commit b0db704652 (pathspec: allow querying for attributes -
2017-03-13) adds new pathspec magic 'attr' but only with
match_pathspec(). "git add" has some pathspec related code that still
does not know about 'attr' and will bail out:

    $ git add ':(attr:foo)'
    fatal: BUG:dir.c:1584: unsupported magic 40

A better solution would be making this code support 'attr'. But I
don't know how much work is needed (I'm not familiar with this new
magic). For now, let's simply reject this magic with a friendlier
message:

    $ git add ':(attr:foo)'
    fatal: :(attr:foo): pathspec magic not supported by this command: 'attr'

Update t6135 so that the expected error message is from the
"graceful" rejection codepath, not "oops, we were supposed to reject
the request to trigger this magic" codepath.

Reported-by: smaudet@sebastianaudet.com
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/add.c
t/t6135-pathspec-with-attrs.sh