Skip to content

Commit

Permalink
doc/git-fsck: change the way for getting heads' SHA1s
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Markus Heidelberg authored and Junio C Hamano committed Dec 21, 2008
1 parent 718258e commit 27c03aa
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Documentation/git-fsck.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 27c03aa

Please sign in to comment.