diff options
author | Johannes Schindelin <johannes.schindelin@gmx.de> | 2025-05-15 13:11:43 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2025-05-15 13:46:46 -0700 |
commit | 655268452cafd061c6c38541a719b6f5b9d528e3 (patch) | |
tree | 06545163b21c41d92e7687aa3a73eb603f3ff98f /commit-graph.c | |
parent | bf0468e2ba64ac358a61cb01a675b7c5919d64fd (diff) |
has_dir_name(): make code more obvious
One thing that might be non-obvious to readers (or to analyzers like
CodeQL) is that the function essentially does nothing when the Git index
is empty, and in particular that it does not look at the value of
`len_eq_last` (which would be uninitialized at that point).
Let's make this much easier to understand, by returning early if the Git
index is empty, and by avoiding empty `else` blocks.
This commit changes indentation and is hence best viewed using
`--ignore-space-change`.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
0 files changed, 0 insertions, 0 deletions