aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@smyrno.hos.anvin.org>2005-09-30 11:02:26 -0700
committerH. Peter Anvin <hpa@smyrno.hos.anvin.org>2005-09-30 11:02:26 -0700
commit039c6f162a63e9d91f360e2e6138e21a4015c543 (patch)
tree94d6d7bf46a4fc75a9044a605cd28d31f30b8674
parent9220282a9c6fae98d326bd10e4f427f1692b71ed (diff)
downloadgit-039c6f162a63e9d91f360e2e6138e21a4015c543.tar.gz
git-039c6f162a63e9d91f360e2e6138e21a4015c543.tar.xz
Better handling of exec extension in the git wrapper script
-rw-r--r--Makefile3
-rwxr-xr-xgit.sh16
2 files changed, 13 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index e5b8a51af..38330c2e9 100644
--- a/Makefile
+++ b/Makefile
@@ -273,7 +273,8 @@ all:
git: git.sh Makefile
rm -f $@+ $@
sed -e '1s|#!.*/sh|#!$(SHELL_PATH)|' \
- -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' <$@.sh >$@+
+ -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
+ -e 's/@@X@@/$(X)/g' <$@.sh >$@+
chmod +x $@+
mv $@+ $@
diff --git a/git.sh b/git.sh
index ea710aafc..2986f08ce 100755
--- a/git.sh
+++ b/git.sh
@@ -11,11 +11,17 @@ case "$#" in
echo "git version @@GIT_VERSION@@"
exit 0 ;;
esac
-
- test -x $path/git-$cmd && exec $path/git-$cmd "$@" ;;
-
- # In case we're running on Cygwin...
- test -x $path/git-$cmd.exe && exec $path/git-$cmd.exe "$@" ;;
+
+ test -x $path/git-$cmd && exec $path/git-$cmd "$@"
+
+ case '@@X@@' in
+ '')
+ ;;
+ *)
+ test -x $path/git-$cmd@@X@@ && exec $path/git-$cmd@@X@@ "$@"
+ ;;
+ esac
+ ;;
esac
echo "Usage: git COMMAND [OPTIONS] [TARGET]"