Re: [PATCH v2 3/3] git-merge-one-file: revise merge error reporting
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 25, 2013, 17:20 UTC
- Message-ID
- <7vboa7z98v.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <7vfvzjz9ej.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> Actually, this one is even better, I think. Again on top of your > two patches applied on 'maint'.
Scratch that one. The "if test -z "$1"" block needs to be moved a bit higher, like this (the log message can stay the same):
diff --git a/git-merge-one-file.sh b/git-merge-one-file.sh index 62016f4..a4ecf33 100755 --- a/git-merge-one-file.sh +++ b/git-merge-one-file.sh @@ -134,9 +134,10 @@ case "${1:-.}${2:-.}${3:-.}" in git merge-file "$src1" "$orig" "$src2" ret=$? msg= - if test $ret != 0 + if test $ret != 0 || test -z "$1" then msg='content conflict' + ret=1 fi # Create the working tree file, using "our tree" version from the @@ -153,11 +154,6 @@ case "${1:-.}${2:-.}${3:-.}" in msg="${msg}permissions conflict: $5->$6,$7" ret=1 fi - if test -z "$1" - then - msg='content conflict' - ret=1 - fi if test $ret != 0 then