]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Makefile: strip leading ./ in $(FIND_SOURCE_FILES)
authorDenton Liu <liu.denton@gmail.com>
Mon, 16 Sep 2019 19:23:14 +0000 (12:23 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Sep 2019 21:32:36 +0000 (14:32 -0700)
Currently, $(FIND_SOURCE_FILES) has two modes: if `git ls-files` is
present, it will use that to enumerate the files in the repository; else
it will use `$(FIND) .` to enumerate the files in the directory.

There is a subtle difference between these two methods, however. With
ls-files, filenames don't have a leading `./` while with $(FIND), they
do. This does not currently pose a problem but in a future patch, we
will be using `filter-out` to process the list of files with the
assumption that there is no prefix.

Unify the two possible invocations in $(FIND_SOURCE_FILES) by using sed
to remove the `./` prefix in the $(FIND) case.

Signed-off-by: Denton Liu <liu.denton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile

index 64a59812808ede62436acced4e2cfb97314f60e7..6dbc4ecfecea473dfed683b0e2579d934fb4ceef 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2614,6 +2614,7 @@ FIND_SOURCE_FILES = ( \
                -o \( -name 'trash*' -type d -prune \) \
                -o \( -name '*.[hcS]' -type f -print \) \
                -o \( -name '*.sh' -type f -print \) \
+               | sed -e 's|^\./||' \
        )
 
 $(ETAGS_TARGET): FORCE