-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
t4129: prevent loss of exit code due to the use of pipes #1636
Conversation
Piping the output of git commands like git-ls-files to another command (grep in this case) hides the exit code returned by these commands. Prevent this by storing the output of git-ls-files to a temporary file and then "grep-ping" from that file. Replace grep with test_grep as the latter is more verbose when it fails. Signed-off-by: Chandra Pratap <chandrapratap3519@gmail.com>
/submit |
Submitted as pull.1636.git.1704891257544.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
On the Git mailing list, Junio C Hamano wrote (reply to this): "Chandra Pratap via GitGitGadget" <gitgitgadget@gmail.com> writes:
> t/t4129-apply-samemode.sh | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
Looks good. Will queue with two instances of a minor style fix (see
below).
> diff --git a/t/t4129-apply-samemode.sh b/t/t4129-apply-samemode.sh
> index e7a7295f1b6..ffabeafa213 100755
> --- a/t/t4129-apply-samemode.sh
> +++ b/t/t4129-apply-samemode.sh
> @@ -41,7 +41,8 @@ test_expect_success FILEMODE 'same mode (index only)' '
> chmod +x file &&
> git add file &&
> git apply --cached patch-0.txt &&
> - git ls-files -s file | grep "^100755"
> + git ls-files -s file > ls-files-output &&
Redirection operator ">" and "<" sticks to the file in question
(look for "> " and "< " in this file and you'd find none), i.e.
git ls-files -s file >ls-files-output &&
Thanks. |
This branch is now known as |
This patch series was integrated into seen via git@9ef2845. |
This patch series was integrated into seen via git@0684b1e. |
There was a status update in the "New Topics" section about the branch Test update. Will merge to 'next'. source: <pull.1636.git.1704891257544.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@b0c587d. |
This patch series was integrated into next via git@fd9b72b. |
This patch series was integrated into seen via git@24e320a. |
There was a status update in the "Cooking" section about the branch Test update. Will merge to 'master'. source: <pull.1636.git.1704891257544.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@bf84fef. |
This patch series was integrated into seen via git@b421118. |
This patch series was integrated into seen via git@1b09562. |
This patch series was integrated into master via git@1b09562. |
This patch series was integrated into next via git@1b09562. |
Closed via 1b09562. |
No description provided.