summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 11031d7)
raw | patch | inline | side by side (parent: 11031d7)
author | Johannes Schindelin <Johannes.Schindelin@gmx.de> | |
Thu, 21 Sep 2006 00:07:19 +0000 (02:07 +0200) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Thu, 21 Sep 2006 05:37:50 +0000 (22:37 -0700) |
Signed-off-by: Junio C Hamano <junkio@cox.net>
receive-pack.c | patch | blob | history |
diff --git a/receive-pack.c b/receive-pack.c
index a6ec9f900d6ff57d6123dbd599e63324c642a79c..ea2dbd4e3398ca90823dcd453cbb52c5dcea135c 100644 (file)
--- a/receive-pack.c
+++ b/receive-pack.c
}
if (deny_non_fast_forwards && !is_null_sha1(old_sha1)) {
struct commit *old_commit, *new_commit;
- struct commit_list *bases;
+ struct commit_list *bases, *ent;
old_commit = (struct commit *)parse_object(old_sha1);
new_commit = (struct commit *)parse_object(new_sha1);
- for (bases = get_merge_bases(old_commit, new_commit, 1);
- bases; bases = bases->next)
- if (!hashcmp(old_sha1, bases->item->object.sha1))
+ bases = get_merge_bases(old_commit, new_commit, 1);
+ for (ent = bases; ent; ent = ent->next)
+ if (!hashcmp(old_sha1, ent->item->object.sha1))
break;
- if (!bases)
+ free_commit_list(bases);
+ if (!ent)
return error("denying non-fast forward;"
- " you should pull first");
+ " you should pull first");
}
safe_create_leading_directories(lock_name);