summaryrefslogtreecommitdiff
path: root/git-lost+found.sh
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-11-12 06:37:38 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-11-12 06:37:38 (GMT)
commitf7a2eb735982e921ae4379f1dcf5f7a023610393 (patch)
tree26fe2c59a8fed68a531e7b855a495f52198162a2 /git-lost+found.sh
parent23ea3e201cea0deea909569e08e950a9ec2345f7 (diff)
parent7765e7ebda7e273bca34e87110be899447068b58 (diff)
downloadgit-f7a2eb735982e921ae4379f1dcf5f7a023610393.zip
git-f7a2eb735982e921ae4379f1dcf5f7a023610393.tar.gz
git-f7a2eb735982e921ae4379f1dcf5f7a023610393.tar.bz2
GIT 0.99.9hv1.0rc1v0.99.9h
This is GIT 1.0-rc1 in disguise. It is plausible that relatively new parts of the system still need tweaking and fixing, but that is why it is not 1.0 but rc ;-). Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-lost+found.sh')
-rwxr-xr-xgit-lost+found.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/git-lost+found.sh b/git-lost+found.sh
new file mode 100755
index 0000000..3892f52
--- /dev/null
+++ b/git-lost+found.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+. git-sh-setup || die "Not a git archive."
+
+laf="$GIT_DIR/lost-found"
+rm -fr "$laf" && mkdir -p "$laf/commit" "$laf/other" || exit
+
+git fsck-objects |
+while read dangling type sha1
+do
+ case "$dangling" in
+ dangling)
+ if git-rev-parse --verify "$sha1^0" >/dev/null 2>/dev/null
+ then
+ dir="$laf/commit"
+ git-show-branch "$sha1"
+ else
+ dir="$laf/other"
+ fi
+ echo "$sha1" >"$dir/$sha1"
+ ;;
+ esac
+done