X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=submodule.c;h=52cdcc6a6347a786deafad34efdb9dc4dc3670ff;hb=73c6b3575bc638b7096ec913bd91193707e2265d;hp=0b709bc2914335853e7525076f5e1d026d5dd779;hpb=2c5c66be6ecdd10f5a88c3548a1494bf9edf483a;p=git.git diff --git a/submodule.c b/submodule.c index 0b709bc29..52cdcc6a6 100644 --- a/submodule.c +++ b/submodule.c @@ -391,7 +391,7 @@ static void commit_need_pushing(struct commit *commit, struct commit_list *paren rev.diffopt.format_callback_data = needs_pushing; diff_tree_combined(commit->object.sha1, parents, n, 1, &rev); - free(parents); + free((void *)parents); } int check_submodule_needs_pushing(unsigned char new_sha1[20], const char *remotes_name) @@ -794,7 +794,7 @@ static void print_commit(struct commit *commit) int merge_submodule(unsigned char result[20], const char *path, const unsigned char base[20], const unsigned char a[20], - const unsigned char b[20]) + const unsigned char b[20], int search) { struct commit *commit_base, *commit_a, *commit_b; int parent_count; @@ -849,6 +849,10 @@ int merge_submodule(unsigned char result[20], const char *path, * user needs to confirm the resolution. */ + /* Skip the search if makes no sense to the calling context. */ + if (!search) + return 0; + /* find commit which merges them */ parent_count = find_first_merges(&merges, path, commit_a, commit_b); switch (parent_count) {