Skip to content

Commit 27c03aa

Browse files
marcowsgitster
authored andcommitted
doc/git-fsck: change the way for getting heads' SHA1s
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 718258e commit 27c03aa

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Documentation/git-fsck.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ that aren't readable from any of the specified head nodes.
7979

8080
So for example
8181

82-
git fsck --unreachable HEAD $(cat .git/refs/heads/*)
82+
git fsck --unreachable HEAD \
83+
$(git for-each-ref --format="%(objectname)" refs/heads)
8384

8485
will do quite a _lot_ of verification on the tree. There are a few
8586
extra validity tests to be added (make sure that tree objects are

0 commit comments

Comments
 (0)