We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c301e7 commit 204893cCopy full SHA for 204893c
git-diff-directory
@@ -6,13 +6,11 @@ if [[ "$1" == "-p" ]]; then
6
shift 1
7
fi
8
9
-if [[ $# == 2 ]]; then
10
- git checkout $2
11
- echo ======================================================================
12
-fi
+HERE=$(pwd)
13
14
-if [[ $stat == true ]]; then
15
- diff -w -U3 -r -x .git . "$1" | diffstat | grep -v only$
16
-else
17
- diff -w -U3 -r -x .git . "$1"
18
+(cd "$1" && git --git-dir=$HERE/.git diff ${2:-HEAD}) | \
+ if [[ $stat == true ]]; then \
+ diffstat | grep -v only$; \
+ else \
+ cat; \
+ fi
0 commit comments