X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=submodule.c;h=0fd10a0fdbf5d1af10819dea808b43f6b13b98a8;hb=02cb67530e62e77d437cd68b4bb4307ab752b6a0;hp=0b709bc2914335853e7525076f5e1d026d5dd779;hpb=47d45a5ebd5bce543a50546d05e8b92c6971acda;p=git.git diff --git a/submodule.c b/submodule.c index 0b709bc29..0fd10a0fd 100644 --- a/submodule.c +++ b/submodule.c @@ -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) {