summaryrefslogtreecommitdiff
path: root/Documentation/config/format.txt
diff options
context:
space:
mode:
authorMatheus Tavares <matheus.bernardino@usp.br>2021-05-06 19:33:15 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-05-06 22:48:11 (GMT)
commit3a7f0908b6d698ab1287840ea604111c28a67a61 (patch)
tree163ecada89691962d93c8bd1a30710c2a4055c88 /Documentation/config/format.txt
parent6ff7f460394745395f3eec1e414ad2300c6a402f (diff)
downloadgit-3a7f0908b6d698ab1287840ea604111c28a67a61.zip
git-3a7f0908b6d698ab1287840ea604111c28a67a61.tar.gz
git-3a7f0908b6d698ab1287840ea604111c28a67a61.tar.bz2
clean: remove unnecessary variable
The variable `matches` used to hold the return of a `dir_path_match()` call that was removed in 95c11ecc73 ("Fix error-prone fill_directory() API; make it only return matches", 2020-04-01). Now `matches` will always hold 0, which is the value it's initialized with; and the condition `matches != MATCHED_EXACTLY` will always evaluate to true. So let's remove this unnecessary variable. Interestingly, it seems that `matches != MATCHED_EXACTLY` was already unnecessary before 95c11ecc73. That's because `remove_directories` is always set to 1 when we have pathspecs; So, in the condition `!remove_directories && matches != MATCHED_EXACTLY`, we would either: - have pathspecs (or have been given `-d`) and ignore `matches` because `remove_directories` is 1; or - not have pathspecs (nor `-d`) and end up just checking that `0 != MATCHED_EXACTLY`, as `matches` would never get reassigned after its zero initialization (because there is no pathspec to match). Signed-off-by: Matheus Tavares <matheus.bernardino@usp.br> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/config/format.txt')
0 files changed, 0 insertions, 0 deletions