]> git.ipfire.org Git - thirdparty/git.git/commit
pathspec: simpler logic to prefix original pathspec elements
authorBrandon Williams <bmwill@google.com>
Wed, 4 Jan 2017 18:04:04 +0000 (10:04 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 9 Jan 2017 02:04:17 +0000 (18:04 -0800)
commit5d8f084a5d63501270d6cc0ff2ce04358ca704d6
treef16b51bc7ab2cbea23146546733d1bec0a78d9a1
parent2aee5849c9b3698b65d74bc354f3cee7213add35
pathspec: simpler logic to prefix original pathspec elements

The logic used to prefix an original pathspec element with 'prefix'
magic is more general purpose and can be used for more than just short
magic.  Remove the extra code paths and rename 'prefix_short_magic' to
'prefix_magic' to better indicate that it can be used in more general
situations.

Also, slightly change the logic which decides when to prefix the
original element in order to prevent a pathspec of "." from getting
converted to "" (empty string).

Signed-off-by: Brandon Williams <bmwill@google.com>
Reviewed-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
pathspec.c