summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8d8b9f6)
raw | patch | inline | side by side (parent: 8d8b9f6)
author | Junio C Hamano <junkio@cox.net> | |
Sat, 23 Dec 2006 07:42:30 +0000 (23:42 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 23 Dec 2006 07:42:30 +0000 (23:42 -0800) |
It is unusual for a tag to point at a non-commit, and it is also
unusual for a tag to have reflog, but that is not an error and
we should still prune its reflog entries just as other refs.
Signed-off-by: Junio C Hamano <junkio@cox.net>
unusual for a tag to have reflog, but that is not an error and
we should still prune its reflog entries just as other refs.
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-reflog.c | patch | blob | history |
diff --git a/builtin-reflog.c b/builtin-reflog.c
index 4097c328ccdfc8c377ccf9c23a4330fe2020c5c8..de31967b99e89e21fe0ddd6aaacb17364d6f3a4b 100644 (file)
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
goto prune;
if ((timestamp < cb->expire_unreachable) &&
- ((old && !in_merge_bases(old, cb->ref_commit)) ||
+ (!cb->ref_commit ||
+ (old && !in_merge_bases(old, cb->ref_commit)) ||
(new && !in_merge_bases(new, cb->ref_commit))))
goto prune;
@@ -126,10 +127,9 @@ static int expire_reflog(const char *ref, const unsigned char *sha1, int unused,
}
cb.ref_commit = lookup_commit_reference_gently(sha1, 1);
- if (!cb.ref_commit) {
- status = error("ref '%s' does not point at a commit", ref);
- goto finish;
- }
+ if (!cb.ref_commit)
+ fprintf(stderr,
+ "warning: ref '%s' does not point at a commit\n", ref);
cb.ref = ref;
cb.expire_total = cmd->expire_total;
cb.expire_unreachable = cmd->expire_unreachable;