Re: [PATCH 3/8] t3305: fix ignored exit code inside loop

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

 



On Wed, Mar 25, 2015 at 6:28 AM, Jeff King <peff@xxxxxxxx> wrote:
> When we test deleting notes, we run "git notes remove" in a
> loop. However, the exit value of the loop will only reflect
> the final note we process. We should break out of the loop
> with a failing exit code as soon as we see a problem.
>
> Note that we can call "exit 1" here without explicitly
> creating a subshell, because the while loop on the
> right-hand side of a pipe executes in its own implicit
> subshell.
>
> Note also that the "break" above does not suffer the same
> problem; it is meant to exit the loop early at a certain
> number of iterations. We can bump it into the conditional of
> the loop to make this more obvious.
>
> Signed-off-by: Jeff King <peff@xxxxxxxx>

Acked-by: Johan Herland <johan@xxxxxxxxxxx>

-- 
Johan Herland, <johan@xxxxxxxxxxx>
www.herland.net
--
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]