Merge branch 'jk/log-cherry-pick-duplicate-patches'

When more than one commit with the same patch ID appears on one
side, "git log --cherry-pick A...B" did not exclude them all when a
commit with the same patch ID appears on the other side.  Now it
does.

* jk/log-cherry-pick-duplicate-patches:
  patch-ids: handle duplicate hashmap entries
This commit is contained in:
Junio C Hamano
2021-01-25 14:19:19 -08:00
4 changed files with 48 additions and 4 deletions

View File

@ -1241,12 +1241,14 @@ static void cherry_pick_list(struct commit_list *list, struct rev_info *revs)
/*
* Have we seen the same patch id?
*/
id = has_commit_patch_id(commit, &ids);
id = patch_id_iter_first(commit, &ids);
if (!id)
continue;
commit->object.flags |= cherry_flag;
id->commit->object.flags |= cherry_flag;
do {
id->commit->object.flags |= cherry_flag;
} while ((id = patch_id_iter_next(id, &ids)));
}
free_patch_ids(&ids);