]>
Commit | Line | Data |
---|---|---|
04e7ca1a JH |
1 | #!/bin/sh |
2 | ||
eefaa4fc | 3 | GIT_DIR=`git-rev-parse --git-dir` || exit $? |
07203659 | 4 | laf="$GIT_DIR/lost-found" |
04e7ca1a JH |
5 | rm -fr "$laf" && mkdir -p "$laf/commit" "$laf/other" || exit |
6 | ||
7 | git fsck-objects | | |
8 | while read dangling type sha1 | |
9 | do | |
10 | case "$dangling" in | |
11 | dangling) | |
12 | if git-rev-parse --verify "$sha1^0" >/dev/null 2>/dev/null | |
13 | then | |
14 | dir="$laf/commit" | |
15 | git-show-branch "$sha1" | |
16 | else | |
17 | dir="$laf/other" | |
18 | fi | |
19 | echo "$sha1" >"$dir/$sha1" | |
20 | ;; | |
21 | esac | |
22 | done |