Better handling of exec extension in the git wrapper script
This commit is contained in:
parent
9220282a9c
commit
039c6f162a
3
Makefile
3
Makefile
@ -273,7 +273,8 @@ all:
|
|||||||
git: git.sh Makefile
|
git: git.sh Makefile
|
||||||
rm -f $@+ $@
|
rm -f $@+ $@
|
||||||
sed -e '1s|#!.*/sh|#!$(SHELL_PATH)|' \
|
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 $@+
|
chmod +x $@+
|
||||||
mv $@+ $@
|
mv $@+ $@
|
||||||
|
|
||||||
|
12
git.sh
12
git.sh
@ -12,10 +12,16 @@ case "$#" in
|
|||||||
exit 0 ;;
|
exit 0 ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
test -x $path/git-$cmd && exec $path/git-$cmd "$@" ;;
|
test -x $path/git-$cmd && exec $path/git-$cmd "$@"
|
||||||
|
|
||||||
# In case we're running on Cygwin...
|
case '@@X@@' in
|
||||||
test -x $path/git-$cmd.exe && exec $path/git-$cmd.exe "$@" ;;
|
'')
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
test -x $path/git-$cmd@@X@@ && exec $path/git-$cmd@@X@@ "$@"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "Usage: git COMMAND [OPTIONS] [TARGET]"
|
echo "Usage: git COMMAND [OPTIONS] [TARGET]"
|
||||||
|
Loading…
Reference in New Issue
Block a user