Skip to content

Commit ef510a3

Browse files
authored
Merge pull request #3264 from dscho/fix-subtree-on-windows
Fix subtree on Windows
2 parents 8d1cc44 + a6f7aa4 commit ef510a3

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

contrib/subtree/git-subtree.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,23 @@
55
# Copyright (C) 2009 Avery Pennarun <[email protected]>
66
#
77

8-
if test -z "$GIT_EXEC_PATH" || test "${PATH#"${GIT_EXEC_PATH}:"}" = "$PATH" || ! test -f "$GIT_EXEC_PATH/git-sh-setup"
8+
if test -z "$GIT_EXEC_PATH" || ! test -f "$GIT_EXEC_PATH/git-sh-setup" || {
9+
test "${PATH#"${GIT_EXEC_PATH}:"}" = "$PATH" &&
10+
test ! "$GIT_EXEC_PATH" -ef "${PATH%%:*}" 2>/dev/null
11+
}
912
then
13+
basename=${0##*[/\\]}
1014
echo >&2 'It looks like either your git installation or your'
1115
echo >&2 'git-subtree installation is broken.'
1216
echo >&2
1317
echo >&2 "Tips:"
1418
echo >&2 " - If \`git --exec-path\` does not print the correct path to"
1519
echo >&2 " your git install directory, then set the GIT_EXEC_PATH"
1620
echo >&2 " environment variable to the correct directory."
17-
echo >&2 " - Make sure that your \`${0##*/}\` file is either in your"
21+
echo >&2 " - Make sure that your \`$basename\` file is either in your"
1822
echo >&2 " PATH or in your git exec path (\`$(git --exec-path)\`)."
19-
echo >&2 " - You should run git-subtree as \`git ${0##*/git-}\`,"
20-
echo >&2 " not as \`${0##*/}\`." >&2
23+
echo >&2 " - You should run git-subtree as \`git ${basename#git-}\`,"
24+
echo >&2 " not as \`$basename\`." >&2
2125
exit 126
2226
fi
2327

0 commit comments

Comments
 (0)