summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f1f0a2b)
raw | patch | inline | side by side (parent: f1f0a2b)
author | Junio C Hamano <junkio@cox.net> | |
Thu, 20 Oct 2005 05:48:16 +0000 (22:48 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 20 Oct 2005 05:49:31 +0000 (22:49 -0700) |
Martin Langhoff noticed that ref^0 barfed correctly when we did not
have the commit in a broken repository, but ref^{commit} didn't.
Signed-off-by: Junio C Hamano <junkio@cox.net>
have the commit in a broken repository, but ref^{commit} didn't.
Signed-off-by: Junio C Hamano <junkio@cox.net>
sha1_name.c | patch | blob | history |
diff --git a/sha1_name.c b/sha1_name.c
index 75c688ecf2d9381d665f4b2f388df4ceaa0fdab5..cc320d3d7fc38787190598034fceb787d95336d6 100644 (file)
--- a/sha1_name.c
+++ b/sha1_name.c
return -1;
if (!type_string) {
o = deref_tag(o);
+ if (!o || (!o->parsed && !parse_object(o->sha1)))
+ return -1;
memcpy(sha1, o->sha1, 20);
}
else {
*/
while (1) {
- if (!o)
+ if (!o || (!o->parsed && !parse_object(o->sha1)))
return -1;
if (o->type == type_string) {
memcpy(sha1, o->sha1, 20);