[PATCH v5 0/2] [Outreachy][Patch v2] t3404: avoid losing exit status to pipes
From: Usman Akinyemi via GitGitGadget <hidden>
Date: 2024-10-07 10:51:52
Changes since v3:
* Replaced the use of grep | wc -l with a simplified ! grep command to
directly check for the absence of "NEVER" in the output. I was not able
to add this in the second patch ( employing test_line_count() to replace
test). I was able to come to this solution with the help of Eric and
Patriack.
Usman Akinyemi (2):
t3404: avoid losing exit status with focus on `git show` and `git
cat-file`
t3404: employing test_line_count() to replace test
t/t3404-rebase-interactive.sh | 73 +++++++++++++++++++++++------------
1 file changed, 49 insertions(+), 24 deletions(-)
base-commit: 90fe3800b92a49173530828c0a17951abd30f0e1
Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-git-1805%2FUnique-Usman%2Favoid_git_pipes-v5
Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-git-1805/Unique-Usman/avoid_git_pipes-v5
Pull-Request: https://github.com/git/git/pull/1805
Range-diff vs v4:
1: bfff7937cd2 = 1: bfff7937cd2 t3404: avoid losing exit status with focus on `git show` and `git cat-file`
2: 864b00997b7 ! 2: 0ce40300fa3 [Outreachy][Patch v1] t3404: employing test_line_count() to replace test
@@ Metadata
Author: Usman Akinyemi [off-list ref]
## Commit message ##
- [Outreachy][Patch v1] t3404: employing test_line_count() to replace test
+ t3404: employing test_line_count() to replace test
Refactor t3404 to replace instances of `test` with `test_line_count()`
for checking line counts. This improves readability and aligns with Git's
@@ Commit message
Signed-off-by: Usman Akinyemi [off-list ref]
- removed test
-
## t/t3404-rebase-interactive.sh ##
@@ t/t3404-rebase-interactive.sh: test_expect_success 'stop on conflicting pick' '
test_cmp expect2 file1 &&
test "$(git diff --name-status |
sed -n -e "/^U/s/^U[^a-z]*//p")" = file1 &&
- test 4 = $(grep -v "^#" < .git/rebase-merge/done | wc -l) &&
-+ grep -v "^#" < .git/rebase-merge/done > actual &&
++ grep -v "^#" < .git/rebase-merge/done >actual &&
+ test_line_count = 4 actual &&
test 0 = $(grep -c "^[^#]" < .git/rebase-merge/git-rebase-todo)
'
--
gitgitgadget