1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-03 18:06:10 +02:00

Better handling of exec extension in the git wrapper script

This commit is contained in:
H. Peter Anvin 2005-09-30 11:02:26 -07:00
parent 9220282a9c
commit 039c6f162a
2 changed files with 13 additions and 6 deletions

View File

@ -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 $@+ $@

16
git.sh
View File

@ -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]"