doc/git-fsck: change the way for getting heads' SHA1s
authorMarkus Heidelberg <markus.heidelberg@web.de>
Sun, 21 Dec 2008 16:30:22 +0000 (17:30 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 21 Dec 2008 20:04:12 +0000 (12:04 -0800)
The straightforward way with using 'cat .git/refs/heads/*' doesn't work
with packed refs as well as branches of the form topic/topic1. So let's
use git-for-each-ref for getting the heads' SHA1s in this example.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-fsck.txt

index d5a76472196a5e67bc6e62411d90377ec3b46e3a..287c4fc5e07ea753c2a3d93bf6480f41aac8c9af 100644 (file)
@@ -79,7 +79,8 @@ that aren't readable from any of the specified head nodes.
 
 So for example
 
-       git fsck --unreachable HEAD $(cat .git/refs/heads/*)
+       git fsck --unreachable HEAD \
+               $(git for-each-ref --format="%(objectname)" refs/heads)
 
 will do quite a _lot_ of verification on the tree. There are a few
 extra validity tests to be added (make sure that tree objects are