diff options
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/submodule.c b/submodule.c index 09a41b59b..68c1ba90b 100644 --- a/submodule.c +++ b/submodule.c @@ -689,7 +689,7 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked) cp.out = -1; cp.dir = path; if (start_command(&cp)) - die("Could not run git status --porcelain"); + die("Could not run 'git status --porcelain' in submodule %s", path); len = strbuf_read(&buf, cp.out, 1024); line = buf.buf; @@ -714,7 +714,7 @@ unsigned is_submodule_modified(const char *path, int ignore_untracked) close(cp.out); if (finish_command(&cp)) - die("git status --porcelain failed"); + die("'git status --porcelain' failed in submodule %s", path); strbuf_release(&buf); return dirty_submodule; @@ -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) { |