Fix the git diff-image command when run from a subdirectory of the git root.

This commit is contained in:
Ewan Mellor
2019-04-29 13:17:30 -07:00
parent 909290e813
commit a2cc75bb1c
2 changed files with 3 additions and 3 deletions

View File

@ -64,7 +64,7 @@ It will tell you what it's done, so it should look something like this:
+ echo '*.jpeg diff=image' >>'/Users/yourname/.gitattributes'
+ echo '*.jpg diff=image' >>'/Users/yourname/.gitattributes'
+ echo '*.png diff=image' >>'/Users/yourname/.gitattributes'
+ git config --global alias.diff-image '!f() { GIT_DIFF_IMAGE_ENABLED=1 git diff "$@"; }; f'
+ git config --global alias.diff-image '!f() { cd -- "${GIT_PREFIX:-.}"; GIT_DIFF_IMAGE_ENABLED=1 git diff "$@"; }; f'
+ git config --global diff.image.command '~/git-diff-image/git_diff_image'
```

View File

@ -69,8 +69,8 @@ addattr jpeg
addattr jpg
addattr png
echo '+ git config --global alias.diff-image '"'"'!f() { GIT_DIFF_IMAGE_ENABLED=1 git diff "$@"; }; f'"'"
git config --global alias.diff-image '!f() { GIT_DIFF_IMAGE_ENABLED=1 git diff "$@"; }; f'
echo '+ git config --global alias.diff-image '"'"'!f() { cd -- "${GIT_PREFIX:-.}"; GIT_DIFF_IMAGE_ENABLED=1 git diff "$@"; }; f'"'"
git config --global alias.diff-image '!f() { cd -- "${GIT_PREFIX:-.}"; GIT_DIFF_IMAGE_ENABLED=1 git diff "$@"; }; f'
echo "+ git config --global diff.image.command '$thisdir_tilde/git_diff_image'"
git config --global diff.image.command "$thisdir_tilde/git_diff_image"