Git development
 help / color / mirror / Atom feed
From: Fredrik Kuivinen <freku045@student.liu.se>
To: junkio@cox.net
Cc: git@vger.kernel.org
Subject: [PATCH] recursive-merge: Don't print a stack trace when read-tree fails.
Date: Sun, 25 Sep 2005 16:48:24 +0200	[thread overview]
Message-ID: <20050925144824.GB20527@c165.ib.student.liu.se> (raw)

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>


---

 git-merge-recursive.py |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

5f47cf871d07317d42470f5fa261257e74b57f0e
diff --git a/git-merge-recursive.py b/git-merge-recursive.py
--- a/git-merge-recursive.py
+++ b/git-merge-recursive.py
@@ -149,7 +149,10 @@ def mergeTrees(head, merge, common, bran
     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)

                 reply	other threads:[~2005-09-25 14:48 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050925144824.GB20527@c165.ib.student.liu.se \
    --to=freku045@student.liu.se \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox