Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix subtree on Windows #3264

Merged
merged 2 commits into from
Jul 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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