summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b17e659)
raw | patch | inline | side by side (parent: b17e659)
author | Linus Torvalds <torvalds@osdl.org> | |
Mon, 21 Nov 2005 20:38:31 +0000 (12:38 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 21 Nov 2005 22:08:49 +0000 (14:08 -0800) |
In a corrupt repository, git-repack produces a pack that does not
contain needed objects without complaining, and the result of this
combined with -d flag can be very painful -- e.g. a lossage of one
tree object can lead to lossage of blobs reachable only through that
tree.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
contain needed objects without complaining, and the result of this
combined with -d flag can be very painful -- e.g. a lossage of one
tree object can lead to lossage of blobs reachable only through that
tree.
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-repack.sh | patch | blob | history | |
pack-objects.c | patch | blob | history |
diff --git a/git-repack.sh b/git-repack.sh
index 4e16d34971d5045b095a42cfe27819e666f157a6..c0f271d1015d4d6abfa332a3baa427f125be3581 100755 (executable)
--- a/git-repack.sh
+++ b/git-repack.sh
if [ "$local" ]; then
pack_objects="$pack_objects --local"
fi
-name=$(git-rev-list --objects $rev_list $(git-rev-parse $rev_parse) |
+name=$(git-rev-list --objects $rev_list $(git-rev-parse $rev_parse) 2>&1 |
git-pack-objects --non-empty $pack_objects .tmp-pack) ||
exit 1
if [ -z "$name" ]; then
diff --git a/pack-objects.c b/pack-objects.c
index 4e941e7392077dca9b511282be13e2b559589e5b..8864a31cc14f4c57fe0115a0bfe73904fdb1ae12 100644 (file)
--- a/pack-objects.c
+++ b/pack-objects.c
unsigned char sha1[20];
if (get_sha1_hex(line, sha1))
- die("expected sha1, got garbage");
+ die("expected sha1, got garbage:\n %s", line);
hash = 0;
p = line+40;
while (*p) {