diff options
| author | Mike McQuaid | 2016-08-22 09:04:15 +0100 |
|---|---|---|
| committer | Mike McQuaid | 2016-08-22 09:04:15 +0100 |
| commit | b6afa228f4974f4af1e8938911e35150aa2991c8 (patch) | |
| tree | 71fd079bc81d8b6989c86c3f6c5b164f5b30d384 /Library | |
| parent | 21ac7de20c6ff36409ccd5aa43ed16076a73c39a (diff) | |
| download | brew-b6afa228f4974f4af1e8938911e35150aa2991c8.tar.bz2 | |
update: make GIT_EXECUTABLE an absolute path.
Otherwise it can end up as e.g. `bin/git` which then breaks when we
`cd` to another directory and try to run it.
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/update.sh | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/update.sh b/Library/Homebrew/cmd/update.sh index dbd1a4de8..7b57bde24 100644 --- a/Library/Homebrew/cmd/update.sh +++ b/Library/Homebrew/cmd/update.sh @@ -17,7 +17,10 @@ source "$HOMEBREW_LIBRARY/Homebrew/utils/lock.sh" git() { if [[ -z "$GIT_EXECUTABLE" ]] then - GIT_EXECUTABLE="$("$HOMEBREW_LIBRARY/Homebrew/shims/scm/git" --homebrew=print-path)" + GIT_EXECUTABLE_RELATIVE="$("$HOMEBREW_LIBRARY/Homebrew/shims/scm/git" --homebrew=print-path)" + GIT_EXECUTABLE_BASE="$(basename "$GIT_EXECUTABLE_RELATIVE")" + GIT_EXECUTABLE_DIR="$(cd "$(dirname "$GIT_EXECUTABLE_RELATIVE")" && pwd)" + GIT_EXECUTABLE="$GIT_EXECUTABLE_DIR/$GIT_EXECUTABLE_BASE" fi "$GIT_EXECUTABLE" "$@" } |
