Skip to content

Commit

Permalink
Merge pull request #3264 from dscho/fix-subtree-on-windows
Browse files Browse the repository at this point in the history
Fix subtree on Windows
  • Loading branch information
dscho committed Jul 5, 2021
2 parents 8d1cc44 + a6f7aa4 commit ef510a3
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions contrib/subtree/git-subtree.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,23 @@
# Copyright (C) 2009 Avery Pennarun <apenwarr@gmail.com>
#

if test -z "$GIT_EXEC_PATH" || test "${PATH#"${GIT_EXEC_PATH}:"}" = "$PATH" || ! test -f "$GIT_EXEC_PATH/git-sh-setup"
if test -z "$GIT_EXEC_PATH" || ! test -f "$GIT_EXEC_PATH/git-sh-setup" || {
test "${PATH#"${GIT_EXEC_PATH}:"}" = "$PATH" &&
test ! "$GIT_EXEC_PATH" -ef "${PATH%%:*}" 2>/dev/null
}
then
basename=${0##*[/\\]}
echo >&2 'It looks like either your git installation or your'
echo >&2 'git-subtree installation is broken.'
echo >&2
echo >&2 "Tips:"
echo >&2 " - If \`git --exec-path\` does not print the correct path to"
echo >&2 " your git install directory, then set the GIT_EXEC_PATH"
echo >&2 " environment variable to the correct directory."
echo >&2 " - Make sure that your \`${0##*/}\` file is either in your"
echo >&2 " - Make sure that your \`$basename\` file is either in your"
echo >&2 " PATH or in your git exec path (\`$(git --exec-path)\`)."
echo >&2 " - You should run git-subtree as \`git ${0##*/git-}\`,"
echo >&2 " not as \`${0##*/}\`." >&2
echo >&2 " - You should run git-subtree as \`git ${basename#git-}\`,"
echo >&2 " not as \`$basename\`." >&2
exit 126
fi

Expand Down

0 comments on commit ef510a3

Please sign in to comment.