summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9886ea4)
raw | patch | inline | side by side (parent: 9886ea4)
author | Martin Koegler <mkoegler@auto.tuwien.ac.at> | |
Mon, 18 Feb 2008 07:31:54 +0000 (08:31 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 18 Feb 2008 07:46:55 +0000 (23:46 -0800) |
Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-show-ref.c | patch | blob | history | |
merge-recursive.c | patch | blob | history | |
sha1_name.c | patch | blob | history | |
shallow.c | patch | blob | history | |
upload-pack.c | patch | blob | history |
diff --git a/builtin-show-ref.c b/builtin-show-ref.c
index 65051d14fde44c14d12099df656ac423bc1c347e..a323633e296cef1797ab1d218cea83c891bc3b8d 100644 (file)
--- a/builtin-show-ref.c
+++ b/builtin-show-ref.c
sha1_to_hex(sha1));
if (obj->type == OBJ_TAG) {
obj = deref_tag(obj, refname, 0);
+ if (!obj)
+ die("git-show-ref: bad tag at ref %s (%s)", refname,
+ sha1_to_hex(sha1));
hex = find_unique_abbrev(obj->sha1, abbrev);
printf("%s %s^{}\n", hex, refname);
}
diff --git a/merge-recursive.c b/merge-recursive.c
index dd52342539cd05e59bb13e956d51251417f21e3c..55ef76f5a5f855475f796dfda39fa3417179be8b 100644 (file)
--- a/merge-recursive.c
+++ b/merge-recursive.c
if (get_sha1(ref, sha1))
die("Could not resolve ref '%s'", ref);
object = deref_tag(parse_object(sha1), ref, strlen(ref));
+ if (!object)
+ return NULL;
if (object->type == OBJ_TREE)
return make_virtual_commit((struct tree*)object,
better_branch_name(ref));
diff --git a/sha1_name.c b/sha1_name.c
index be8489e4e5fc98c6e38036a40fb5ca8c0db77ebc..ed3c867d6ad5ed181033950fbcca8daa605e6f20 100644 (file)
--- a/sha1_name.c
+++ b/sha1_name.c
struct object *object = parse_object(sha1);
if (!object)
return 0;
- if (object->type == OBJ_TAG)
+ if (object->type == OBJ_TAG) {
object = deref_tag(object, path, strlen(path));
+ if (!object)
+ return 0;
+ }
if (object->type != OBJ_COMMIT)
return 0;
insert_by_date((struct commit *)object, list);
diff --git a/shallow.c b/shallow.c
index dbd9f5ad0ac21e70fc3a095d8e2938f245c238d3..212e62b77ceea1f81c1938f012099e828f45aa85 100644 (file)
--- a/shallow.c
+++ b/shallow.c
if (i < heads->nr) {
commit = (struct commit *)
deref_tag(heads->objects[i++].item, NULL, 0);
- if (commit->object.type != OBJ_COMMIT) {
+ if (!commit || commit->object.type != OBJ_COMMIT) {
commit = NULL;
continue;
}
diff --git a/upload-pack.c b/upload-pack.c
index 51e3ec49d120f2e5a095cde45eb0a22bb7e624da..eaea9990e944ead3d03967bcb026539cd2dc39eb 100644 (file)
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -575,7 +575,8 @@ static int send_ref(const char *refname, const unsigned char *sha1, int flag, vo
}
if (o->type == OBJ_TAG) {
o = deref_tag(o, refname, 0);
- packet_write(1, "%s %s^{}\n", sha1_to_hex(o->sha1), refname);
+ if (o)
+ packet_write(1, "%s %s^{}\n", sha1_to_hex(o->sha1), refname);
}
return 0;
}