Thomas Gummerer <t.gumme...@gmail.com> writes:

> @@ -322,9 +322,12 @@ push_stash () {
>  
>               if test $# != 0
>               then
> -                     git add -u -- "$@" |
> -                     git checkout-index -z --force --stdin

This obviously is not something this patch breaks, but I am finding
this pipeline that was already here quite puzzling.

The "add -u" is about adding the changes in paths that match the
pathspec to the index; the output from it is meant for human
consumption and certainly is not something "--stdin" should expect
to be understandable, let alone with "-z".

        ... goes and digs ...

I think you mis-copied the suggestion in

    https://public-inbox.org/git/xmqqpo7byjwb....@gitster.mtv.corp.google.com/

when you made bba067d2 ("stash: don't delete untracked files that
match pathspec", 2018-01-06), and nobody caught that breakage during
the review.

> -                     git diff-index -p --cached --binary HEAD -- "$@" | git 
> apply --index -R
> +                     if git ls-files --error-unmatch -- "$@" >/dev/null 
> 2>/dev/null
> +                     then
> +                             git add -u -- "$@" |
> +                             git checkout-index -z --force --stdin

And the same breakage is inherited here; just drop "|" and
downstream "checkout-index" and you should be OK.

> +                             git diff-index -p --cached --binary HEAD -- 
> "$@" | git apply --index -R

And while at it, let's split this to two lines after "|".

> +                     fi

Reply via email to