From 6745b3c106485f5607d7e1e6251878d429591186 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Sun, 8 Mar 2009 21:52:14 +0100 Subject: [PATCH] Fix merge failure handling in tg export MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit There exist two problems that show that up to now the error handling was completely untested: - tg.sh uses `set -e`, so `git merge $branch; retmerge=$?` obviously doesn't do the right thing. - in recurse_deps stdin is redirected from $_depsfile. Starting a shell with that doesn't give the user any chance to do something. Reported-by: "Bernhard R. Link" Signed-off-by: Uwe Kleine-König --- tg-export.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/tg-export.sh b/tg-export.sh index 748ca54..37cd9cd 100644 --- a/tg-export.sh +++ b/tg-export.sh @@ -216,22 +216,24 @@ linearize() # already included, just skip :; else - git merge -s recursive "$_dep"; - retmerge="$?"; + retmerge=0; + + git merge -s recursive "$_dep" || retmerge="$?"; if test "x$retmerge" != "x0"; then echo fix up the merge, commit and then exit; #todo error handling - sh -i + sh -i