diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-05-27 13:59:10 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-05-27 13:59:11 -0700 |
| commit | f9cdaa2860e20f3f36595646b7a82082aa772df8 (patch) | |
| tree | 40513df8eb4aec40cc4ec28e0ba4855d532be476 /builtin/commit.c | |
| parent | Merge branch 'sj/use-mmap-to-check-packed-refs' (diff) | |
| parent | sequencer: stop pretending that an assignment is a condition (diff) | |
| download | git-f9cdaa2860e20f3f36595646b7a82082aa772df8.tar.gz git-f9cdaa2860e20f3f36595646b7a82082aa772df8.zip | |
Merge branch 'js/misc-fixes'
Assorted fixes for issues found with CodeQL.
* js/misc-fixes:
sequencer: stop pretending that an assignment is a condition
bundle-uri: avoid using undefined output of `sscanf()`
commit-graph: avoid using stale stack addresses
trace2: avoid "futile conditional"
Avoid redundant conditions
fetch: avoid unnecessary work when there is no current branch
has_dir_name(): make code more obvious
upload-pack: rename `enum` to reflect the operation
commit-graph: avoid malloc'ing a local variable
fetch: carefully clear local variable's address after use
commit: simplify code
Diffstat (limited to 'builtin/commit.c')
| -rw-r--r-- | builtin/commit.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c index 66bd91fd52..fba0dded64 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1022,7 +1022,7 @@ static int prepare_to_commit(const char *index_file, const char *prefix, for (i = 0; i < the_repository->index->cache_nr; i++) if (ce_intent_to_add(the_repository->index->cache[i])) ita_nr++; - committable = the_repository->index->cache_nr - ita_nr > 0; + committable = the_repository->index->cache_nr > ita_nr; } else { /* * Unless the user did explicitly request a submodule |
