Re: [PATCH v3 3/4] refs: make refs/worktree/* per-worktree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Haggerty <mhagger@xxxxxxxxxxxx> writes:

> I don't see how that can help. The result of a pipeline is taken from
> the last command. The exit codes of earlier commands in the pipeline are
> lost in the sands of time:
>
>     $ false | true
>     $ echo $?
>     0
>     $ false | ( ! false )
>     $ echo $?
>     0
>
> Working around this POSIX shell limitation is surprisingly awkward in a
> general-purpose script. But in this case you could use a temporary file:
>
>     git for-each-ref >refs-actual &&
>     ! grep refs/worktree <refs-actual && [...]

It is not just "you could", but that is what you "should" do, if you
cared the exit status from for-each-ref.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]