Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH v2 3/3] git-merge-one-file: revise merge error reporting

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:30
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Junio C Hamano [off-list ref] 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help