{"thread":{"id":"63239","subject":"[GSoC 2025] [PATCH 1/1] t9811: avoid using pipes","startedAt":"2025-04-02T08:15:50Z","lastAt":"2025-04-02T08:15:50Z","messageCount":1,"participants":["wang-anthony03"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"515489","messageId":"20250402081545.94784-1-anthonywang03@icloud.com","threadId":"63239","inReplyTo":null,"subject":"[GSoC 2025] [PATCH 1/1] t9811: avoid using pipes","fromName":"wang-anthony03","fromEmail":"anthonywang513@gmail.com","sentAt":"2025-04-02T08:15:45Z","receivedAt":"2025-04-02T08:15:50Z","isPatch":true,"sender":{"key":"anthonywang513@gmail.com","avatar":"https://avatars.githubusercontent.com/u/71832477?v=4"},"body":"wang-anthony03 (1):\n  The exit code of the upstream in a pipe is suppressed thus we lose any\n    exit codes of git commands that are piped. In order to ensure we\n    pick up the exit code, we can write the output of the git command to\n    a file, testing the exit codes of both the commands.\n\nSigned-off-by: Anthony Wang <anthonywang513@gmail.com>\n---\n t/t9811-git-p4-label-import.sh | 10 ++++++----\n 1 file changed, 6 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t9811-git-p4-label-import.sh b/t/t9811-git-p4-label-import.sh\nindex 5ac5383fb7..5abac938d0 100755\n--- a/t/t9811-git-p4-label-import.sh\n+++ b/t/t9811-git-p4-label-import.sh\n@@ -95,9 +95,10 @@ test_expect_success 'two labels on the same changelist' '\n \t\tcd \"$git\" &&\n \t\tgit p4 sync --import-labels &&\n \n-\t\tgit tag | grep TAG_F1 &&\n-\t\tgit tag | grep -q TAG_F1_1 &&\n-\t\tgit tag | grep -q TAG_F1_2 &&\n+\t\tgit tag >output &&\n+\t\tgrep TAG_F1 output &&\n+\t\tgrep -q TAG_F1_1 output &&\n+\t\tgrep -q TAG_F1_2 output &&\n \n \t\tcd main &&\n \n@@ -208,7 +209,8 @@ test_expect_success 'use git config to enable import/export of tags' '\n \t\tgit p4 rebase --verbose &&\n \t\tgit p4 submit --verbose &&\n \t\tgit tag &&\n-\t\tgit tag | grep TAG_F1_1\n+\t\tgit tag >output &&\n+\t\tgrep TAG_F1_1 output\n \t) &&\n \t(\n \t\tcd \"$cli\" &&\n-- \n2.39.5 (Apple Git-154)\n\n"}]}