X-Git-Url: https://git.phdru.name/?p=git-scripts.git;a=blobdiff_plain;f=ls-not-packed;h=d01a9539f44931c51ccd45523b9757786a1a4e3f;hp=d2bb878ebfa16a2722b2f20869bff0611bab5e5b;hb=b90789d369c5500fa85a0954869626e8aa3566ce;hpb=9d1f4913c3228f846cfe1eb81e42dc1a2902b29c diff --git a/ls-not-packed b/ls-not-packed index d2bb878..d01a953 100755 --- a/ls-not-packed +++ b/ls-not-packed @@ -1,4 +1,12 @@ #! /bin/sh +COUNT_OBJ_PRG="git count-objects -v | grep ^count: | cut -c 8-" +export COUNT_OBJ_PRG + exec "`dirname \"$0\"`"/do-all \ - 'test "`ls -1 \"$g\"/objects 2>/dev/null | wc -l`" -gt 2 && echo "$d"' + 'cd "$d" && count_obj=`eval $COUNT_OBJ_PRG`; ' \ + 'if [ "$d" != "$g" ]; then' \ + 'for c in `eval git submodule foreach $COUNT_OBJ_PRG`;' \ + 'do count_obj=`expr $count_obj + $c`; done; ' \ + 'fi; ' \ + 'test $count_obj -gt 1 && echo "$d"' \