]>
Commit | Line | Data |
---|---|---|
04e7ca1a JH |
1 | #!/bin/sh |
2 | ||
d20e2f16 FK |
3 | USAGE='' |
4 | SUBDIRECTORY_OK='Yes' | |
5 | . git-sh-setup | |
6 | ||
7 | if [ "$#" != "0" ] | |
8 | then | |
9 | usage | |
10 | fi | |
11 | ||
07203659 | 12 | laf="$GIT_DIR/lost-found" |
04e7ca1a JH |
13 | rm -fr "$laf" && mkdir -p "$laf/commit" "$laf/other" || exit |
14 | ||
df391b19 | 15 | git fsck --full | |
04e7ca1a JH |
16 | while read dangling type sha1 |
17 | do | |
18 | case "$dangling" in | |
19 | dangling) | |
20 | if git-rev-parse --verify "$sha1^0" >/dev/null 2>/dev/null | |
21 | then | |
22 | dir="$laf/commit" | |
23 | git-show-branch "$sha1" | |
24 | else | |
25 | dir="$laf/other" | |
26 | fi | |
27 | echo "$sha1" >"$dir/$sha1" | |
28 | ;; | |
29 | esac | |
30 | done |