]> git.phdru.name Git - git-scripts.git/commitdiff
New algorithm to find non-packed repos
authorOleg Broytman <phd@phdru.name>
Tue, 7 Jul 2015 14:32:41 +0000 (17:32 +0300)
committerOleg Broytman <phd@phdru.name>
Tue, 7 Jul 2015 14:32:41 +0000 (17:32 +0300)
Consider repos with files in refs and rerere cache not packed.

ls-not-packed

index d2bb878ebfa16a2722b2f20869bff0611bab5e5b..a674f59d80feb3adc22c17141b031f1b1cef920a 100755 (executable)
@@ -1,4 +1,6 @@
 #! /bin/sh
 
 exec "`dirname \"$0\"`"/do-all \
-   'test "`ls -1 \"$g\"/objects 2>/dev/null | wc -l`" -gt 2 && echo "$d"'
+   'test \
+      "`find \"$g\"/objects/ \"$g\"/refs/ \"$g\"/rr-cache/ \
+         ! -name HEAD -type f 2>/dev/null | wc -l`" -gt 3 && echo "$d"'