Skip to content

Commit

Permalink
Make git-diffall run from a subdirectory.
Browse files Browse the repository at this point in the history
Work around breakage in msysGit's implementation of `git rev-parse --show-toplevel` which returns "c:/stuff" instead of "/c/stuff".
  • Loading branch information
georgevreilly committed Dec 31, 2010
1 parent 761d024 commit c349207
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion git-diffall
Expand Up @@ -12,6 +12,7 @@ commit SHA1 of a commit
path Limit the diff to the specified paths
'

SUBDIRECTORY_OK=1
. "$(git --exec-path)/git-sh-setup"

if [ -z $(git config --get diff.tool) ]; then
Expand All @@ -20,7 +21,13 @@ if [ -z $(git config --get diff.tool) ]; then
fi

start_dir=$(pwd)
cd_to_toplevel # needed to access tar utility

# needed to access tar utility
cdup=$(git rev-parse --show-cdup) &&
cd "$cdup" || {
echo >&2 "Cannot chdir to $cdup, the toplevel of the working tree"
exit 1
}

# mktemp is not available on all platforms (missing from msysgit)
# Use a hard-coded tmp dir if it is not available
Expand Down

0 comments on commit c349207

Please sign in to comment.