]> granicus.if.org Git - curl/commitdiff
delta: use --diff-filter on the git diff-tree invokes
authorDaniel Stenberg <daniel@haxx.se>
Tue, 11 Dec 2018 14:25:52 +0000 (15:25 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 11 Dec 2018 14:32:34 +0000 (15:32 +0100)
Suggested-by: Dave Reisner
scripts/delta

index 779ab50d9c0aceed75d2f105f7a9b6843b538e74..3318a58ef942cd385e23b9b034ae16fac95f86d6 100755 (executable)
@@ -64,8 +64,8 @@ $noptions=$aoptions - $boptions;
 
 # Number of files in git
 $afiles=`git ls-files | wc -l`;
-$deletes=`git diff-tree -r --summary origin/master $start | grep -c create`;
-$creates=`git diff-tree -r --summary origin/master $start | grep -c delete`;
+$deletes=`git diff-tree --diff-filter=A -r --summary origin/master $start | wc -l`;
+$creates=`git diff-tree --diff-filter=D -r --summary origin/master $start | wc -l`;
 
 # Time since that tag
 $tagged=`git for-each-ref --format="%(refname:short) | %(taggerdate:unix)" refs/tags/* | grep ^$start | cut "-d|" -f2`; # unix timestamp