>>>>> "LT" == Linus Torvalds <[EMAIL PROTECTED]> writes:

LT> What's the right way?

LT> Maybe

LT>     if merge "$src2" "$orig" "$src1"
LT>     then 
LT>             cp "$src2" "$4" && update-cache --add -- "$4" && exit 0
LT>     fi
LT>     echo Leaving conflict merge in $src2
LT>     exit 1

LT> would work?

Wouldn't this be more readable, short and sweet?

    merge "$src2" "$orig" "$src1" || {
        echo Leaving conflict merge in $src2 && exit 1
    }
    cp "$src2" "$4" && exec update-cache --add -- "$4"

You did not want subshell so I just changed the () pair to the
{} pair, and while I was at it I folded the "&& exit 0" into the
last command before it, which should be better.  You'd want to
know if update-cache --add failed for whatever reason.

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

Reply via email to