mirror of
https://github.com/git/git.git
synced 2026-03-14 10:53:25 +01:00
Merge branch 'jc/fsck-reflog' into next
* jc/fsck-reflog: git reflog expire Move in_merge_bases() to commit.c reflog: fix warning message. Teach git-repack to preserve objects referred to by reflog entries. Protect commits recorded in reflog from pruning. add for_each_reflog_ent() iterator diff documentation: mostly talk about <commit> compat/inet_ntop: do not use u_int git-add: error out when given no arguments. Conflicts: commit.h
This commit is contained in:
17
commit.c
17
commit.c
@@ -1043,3 +1043,20 @@ struct commit_list *get_merge_bases(struct commit *one,
|
||||
free(rslt);
|
||||
return result;
|
||||
}
|
||||
|
||||
int in_merge_bases(struct commit *rev1, struct commit *rev2)
|
||||
{
|
||||
struct commit_list *bases, *b;
|
||||
int ret = 0;
|
||||
|
||||
bases = get_merge_bases(rev1, rev2, 1);
|
||||
for (b = bases; b; b = b->next) {
|
||||
if (!hashcmp(rev1->object.sha1, b->item->object.sha1)) {
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
free_commit_list(bases);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user