diff options
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/commit.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 400d2a54e..1e74bc19f 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -894,9 +894,14 @@ static int prepare_to_commit(const char *index_file, const char *prefix, if (amend) parent = "HEAD^1"; - if (get_sha1(parent, sha1)) - commitable = !!active_nr; - else { + if (get_sha1(parent, sha1)) { + int i, ita_nr = 0; + + for (i = 0; i < active_nr; i++) + if (ce_intent_to_add(active_cache[i])) + ita_nr++; + commitable = active_nr - ita_nr > 0; + } else { /* * Unless the user did explicitly request a submodule * ignore mode by passing a command line option we do |