summaryrefslogtreecommitdiff
path: root/git-merge-recursive.py
diff options
context:
space:
mode:
authorFredrik Kuivinen <freku045@student.liu.se>2005-09-25 14:48:24 (GMT)
committerJunio C Hamano <junkio@cox.net>2005-09-25 23:08:53 (GMT)
commit0bed18998ae6c0cec1485e6295be16a4fcebc7a7 (patch)
tree976e661a6944005201b73ec14424a69fbeaff3d2 /git-merge-recursive.py
parent946f5f7c245a0f9398417be5946795cfebfd1c62 (diff)
downloadgit-0bed18998ae6c0cec1485e6295be16a4fcebc7a7.zip
git-0bed18998ae6c0cec1485e6295be16a4fcebc7a7.tar.gz
git-0bed18998ae6c0cec1485e6295be16a4fcebc7a7.tar.bz2
[PATCH] recursive-merge: Don't print a stack trace when read-tree fails.
If the working tree is dirty read-tree will fail, and we don't want an ugly stack trace in that case. Also make sure we don't print stack traces when we use 'die'. Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-merge-recursive.py')
-rwxr-xr-xgit-merge-recursive.py12
1 files changed, 9 insertions, 3 deletions
diff --git a/git-merge-recursive.py b/git-merge-recursive.py
index 60e8b21..689f914 100755
--- a/git-merge-recursive.py
+++ b/git-merge-recursive.py
@@ -149,7 +149,10 @@ def mergeTrees(head, merge, common, branch1Name, branch2Name,
else:
updateArg = '-u'
- runProgram(['git-read-tree', updateArg, '-m', common, head, merge])
+ [out, code] = runProgram(['git-read-tree', updateArg, '-m', common, head, merge], returnCode = True)
+ if code != 0:
+ die('git-read-tree:', out)
+
cleanMerge = True
[tree, code] = runProgram('git-write-tree', returnCode=True)
@@ -430,8 +433,11 @@ try:
print ''
except:
- traceback.print_exc(None, sys.stderr)
- sys.exit(2)
+ if isinstance(sys.exc_info()[1], SystemExit):
+ raise
+ else:
+ traceback.print_exc(None, sys.stderr)
+ sys.exit(2)
if clean:
sys.exit(0)