summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6291709)
raw | patch | inline | side by side (parent: 6291709)
author | Junio C Hamano <junkio@cox.net> | |
Thu, 28 Jul 2005 21:33:17 +0000 (14:33 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 29 Jul 2005 07:12:02 +0000 (00:12 -0700) |
Linux 2.6 tree has one of those tree tags.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
server-info.c | patch | blob | history |
diff --git a/server-info.c b/server-info.c
index 00f8ca0c585ce3bc5a84f4977d1bca364508a714..3dd201afb97db5233835ce44f856d5750f6a10cd 100644 (file)
--- a/server-info.c
+++ b/server-info.c
#include "refs.h"
#include "object.h"
#include "commit.h"
+#include "tag.h"
#include "rev-cache.h"
/* refs */
/* rev-cache */
static int record_rev_cache_ref(const char *path, const unsigned char *sha1)
{
- struct commit *commit;
- if (!(commit = lookup_commit_reference(sha1)))
- return error("not a commit: %s", sha1_to_hex(sha1));
- return record_rev_cache(commit->object.sha1, NULL);
+ struct object *obj = parse_object(sha1);
+
+ if (!obj)
+ return error("ref %s has bad sha %s", path, sha1_to_hex(sha1));
+ while (obj && obj->type == tag_type)
+ obj = parse_object(((struct tag *)obj)->tagged->sha1);
+ if (!obj || obj->type != commit_type)
+ /* tag pointing at a non-commit */
+ return 0;
+ return record_rev_cache(obj->sha1, NULL);
}
static int update_info_revs(int force)