Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: git pull fails to exit with non-zero status after fatal error

From: Johannes Schindelin <hidden>
Date: 2016-06-15 22:42:58
Subsystem: the rest · Maintainer: Linus Torvalds

Hi,

On Sat, 3 Mar 2007, Larry Streepy wrote:
We have just upgraded to 1.5 (don't know if this is specific to 1.5, but just
in case).  When I perform a git-pull on a working repo that has a modified
file, git pull refuses to do the pull, as shown below:

$ git pull
Updating b5d9263..506b347
tools/Pvt/Pvt.py: needs update
fatal: Entry 'tools/Pvt/Pvt.py' not uptodate. Cannot merge.
$ echo $?
0

Notice the exit status of 0.
Does this fix it?
diff --git a/git-merge.sh b/git-merge.sh
index 498c938..6b23bf5 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -295,8 +295,9 @@ f,*)
 	new_head=$(git-rev-parse --verify "$1^0") &&
 	git-read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" &&
 	finish "$new_head" "Fast forward"
+	ret=$?
 	dropsave
-	exit 0
+	exit $ret
 	;;
 ?,1,?*"$LF"?*,*)
 	# We are not doing octopus and not fast forward.  Need a
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help