We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7ae0774 commit 76ba3bfCopy full SHA for 76ba3bf
git-size
@@ -1,13 +1,13 @@
1
#!/bin/bash
2
3
-args=$(git rev-parse --short "$@")
4
-eval "git diff-tree -r $args" | {
+# args=$(git rev-parse --short "$@")
+
5
+eval "git diff-tree -r $@" | {
6
total=0
- while read A B C D M P
7
- do
+ while read A B C D M P; do
8
if [[ -z $M ]]; then continue; fi
9
case $M in
10
- M) bytes=$(( $(git cat-file -s $D) - $(git cat-file -s $C) )) ;;
+ M) bytes=$(( $(git cat-file -s $D || echo 0) - $(git cat-file -s $C || echo 0) )) ;;
11
A) bytes=$(git cat-file -s $D) ;;
12
D) bytes=-$(git cat-file -s $C) ;;
13
*)
@@ -22,6 +22,6 @@ eval "git diff-tree -r $args" | {
22
if (( $total < 1000 )); then
23
echo ${total} bytes
24
else
25
- echo $(( total / 1000))KB
+ echo $(( total / 1000 ))KB
26
fi
27
}
0 commit comments