Skip to content

Commit

Permalink
Better handling of exec extension in the git wrapper script
Browse files Browse the repository at this point in the history
  • Loading branch information
H. Peter Anvin committed Sep 30, 2005
1 parent 9220282 commit 039c6f1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 $@+ $@

Expand Down
16 changes: 11 additions & 5 deletions git.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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]"
Expand Down

0 comments on commit 039c6f1

Please sign in to comment.