aboutsummaryrefslogtreecommitdiff
path: root/builtin-reflog.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-12-22 23:42:30 -0800
committerJunio C Hamano <junkio@cox.net>2006-12-22 23:42:30 -0800
commit58748293f6fa450c6db89a78bd20aae7bf708d3b (patch)
tree77259b0fa4f0018fc9d4d7461553c24aa6df69c0 /builtin-reflog.c
parent8d8b9f6252271899708b32fbce4cd2541af9545a (diff)
downloadgit-58748293f6fa450c6db89a78bd20aae7bf708d3b.tar.gz
git-58748293f6fa450c6db89a78bd20aae7bf708d3b.tar.xz
reflog expire: do not punt on tags that point at non commits.
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>
Diffstat (limited to 'builtin-reflog.c')
-rw-r--r--builtin-reflog.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin-reflog.c b/builtin-reflog.c
index 4097c328c..de31967b9 100644
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
@@ -80,7 +80,8 @@ static int expire_reflog_ent(unsigned char *osha1, unsigned char *nsha1,
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;