Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Sunshine <sunshine@sunshineco.com>2022-11-08 22:08:27 +0300
committerTaylor Blau <me@ttaylorr.com>2022-11-08 23:10:49 +0300
commitc90d81f8bb691b6627497e69d599e1f7fa7e9dfa (patch)
tree5077ea421a2b14023ccb01b38ed4725d54d6fc82 /t/chainlint.pl
parent3b08839926fcc7cc48cf4c759737c1a71af430c1 (diff)
chainlint: add explanatory comments
The logic in TestParser::accumulate() for detecting broken &&-chains is mostly well-commented, but a couple branches which were deemed obvious and straightforward lack comments. In retrospect, though, these cases may give future readers pause, so comment them, as well. Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Taylor Blau <me@ttaylorr.com>
Diffstat (limited to 't/chainlint.pl')
-rwxr-xr-xt/chainlint.pl4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/chainlint.pl b/t/chainlint.pl
index 976db4b8a0..9908de6c75 100755
--- a/t/chainlint.pl
+++ b/t/chainlint.pl
@@ -505,7 +505,11 @@ my @safe_endings = (
sub accumulate {
my ($self, $tokens, $cmd) = @_;
+
+ # no previous command to check for missing "&&"
goto DONE unless @$tokens;
+
+ # new command is empty line; can't yet check if previous is missing "&&"
goto DONE if @$cmd == 1 && $$cmd[0] eq "\n";
# did previous command end with "&&", "|", "|| return" or similar?