summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ba70de0)
raw | patch | inline | side by side (parent: ba70de0)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 12 Jan 2007 03:56:43 +0000 (19:56 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 12 Jan 2007 03:56:43 +0000 (19:56 -0800) |
When --stale-fix is not passed, the code did not initialize the
two commit objects properly.
Signed-off-by: Junio C Hamano <junkio@cox.net>
two commit objects properly.
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 ca22452e64f99a24f5f13923d2d6a756bcf82ade..7206b7a0139099c78b36f53c84705312f8daf8e5 100644 (file)
--- a/builtin-reflog.c
+++ b/builtin-reflog.c
{
struct commit *commit;
- *it = NULL;
if (is_null_sha1(sha1))
return 1;
commit = lookup_commit_reference_gently(sha1, 1);
if (timestamp < cb->cmd->expire_total)
goto prune;
+ old = new = NULL;
if (cb->cmd->stalefix &&
(!keep_entry(&old, osha1) || !keep_entry(&new, nsha1)))
goto prune;
- if ((timestamp < cb->cmd->expire_unreachable) &&
- (!cb->ref_commit ||
- (old && !in_merge_bases(old, cb->ref_commit)) ||
- (new && !in_merge_bases(new, cb->ref_commit))))
- goto prune;
+ if (timestamp < cb->cmd->expire_unreachable) {
+ if (!cb->ref_commit)
+ goto prune;
+ if (!old && !is_null_sha1(osha1))
+ old = lookup_commit_reference_gently(osha1, 1);
+ if (!new && !is_null_sha1(nsha1))
+ new = lookup_commit_reference_gently(nsha1, 1);
+ if ((old && !in_merge_bases(old, cb->ref_commit)) ||
+ (new && !in_merge_bases(new, cb->ref_commit)))
+ goto prune;
+ }
if (cb->newlog) {
char sign = (tz < 0) ? '-' : '+';