@matheusbsbs / matheus-bagliano / commits / 039c6f162a
Fork 0

Better handling of exec extension in the git wrapper script

H. Peter Anvin committed Sep 30, 2005 at 11:02 UTC 039c6f162a63e9d91f360e2e6138e21a4015c543
2 files changed +13 -6
Makefile
+2 -1
@@ -273,7 +273,8 @@ all:
273 git: git.sh Makefile
274 rm -f $@+ $@
275 sed -e '1s|#!.*/sh|#!$(SHELL_PATH)|' \
276 - -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' <$@.sh >$@+
276 + -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
277 + -e 's/@@X@@/$(X)/g' <$@.sh >$@+
278 chmod +x $@+
279 mv $@+ $@
280
git.sh
+11 -5
@@ -11,11 +11,17 @@ case "$#" in
11 echo "git version @@GIT_VERSION@@"
12 exit 0 ;;
13 esac
14 -
15 - test -x $path/git-$cmd && exec $path/git-$cmd "$@" ;;
16 -
17 - # In case we're running on Cygwin...
18 - test -x $path/git-$cmd.exe && exec $path/git-$cmd.exe "$@" ;;
14 +
15 + test -x $path/git-$cmd && exec $path/git-$cmd "$@"
16 +
17 + case '@@X@@' in
18 + '')
19 + ;;
20 + *)
21 + test -x $path/git-$cmd@@X@@ && exec $path/git-$cmd@@X@@ "$@"
22 + ;;
23 + esac
24 + ;;
25 esac
26
27 echo "Usage: git COMMAND [OPTIONS] [TARGET]"