Do not try to remove directories when removing old links
authorSebastian Schuberth <sschuberth@gmail.com>
Tue, 27 Oct 2009 11:23:33 +0000 (12:23 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Oct 2009 06:45:41 +0000 (23:45 -0700)
When building Git with MSVC on Windows, directories named after the Git alias
are created for the output files, e.g. there is a "git-merge-index" directory
next to the "git-merge-index.exe" executable in the build root. Previously,
"make all" just checked if "git-merge-index" and "git-merge-index.exe" are the
same file, and if not, tried to remove "git-merge-index". This fails in the
case of "git-merge-index" being a directory, which is why this is checked now.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Makefile

index 42b7d60e195559c8c0a7c6b32ce3b7ab8cfacebd..268aede566c29bdf5f4e19fb2a6819fc197c0fbb 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1375,7 +1375,7 @@ SHELL = $(SHELL_PATH)
 
 all:: shell_compatibility_test $(ALL_PROGRAMS) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
 ifneq (,$X)
-       $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test '$p' -ef '$p$X' || $(RM) '$p';)
+       $(QUIET_BUILT_IN)$(foreach p,$(patsubst %$X,%,$(filter %$X,$(ALL_PROGRAMS) $(BUILT_INS) git$X)), test -d '$p' -o '$p' -ef '$p$X' || $(RM) '$p';)
 endif
 
 all::