git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Wong <andrew.kw.w@gmail.com>
To: git@vger.kernel.org
Cc: Andrew Wong <andrew.kw.w@gmail.com>
Subject: [PATCH] rebase -m: only call "notes copy" when rewritten exists and is non-empty
Date: Fri, 24 Feb 2012 23:31:22 -0500	[thread overview]
Message-ID: <1330144282-22540-1-git-send-email-andrew.kw.w@gmail.com> (raw)

This prevents a shell error complaining rebase-merge/rewritten doesn't exist.

Signed-off-by: Andrew Wong <andrew.kw.w@gmail.com>
---
 git-rebase--merge.sh |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/git-rebase--merge.sh b/git-rebase--merge.sh
index 26afc75..5e9d95f 100644
--- a/git-rebase--merge.sh
+++ b/git-rebase--merge.sh
@@ -90,10 +90,11 @@ call_merge () {
 
 finish_rb_merge () {
 	move_to_original_branch
-	git notes copy --for-rewrite=rebase < "$state_dir"/rewritten
-	if test -x "$GIT_DIR"/hooks/post-rewrite &&
-		test -s "$state_dir"/rewritten; then
-		"$GIT_DIR"/hooks/post-rewrite rebase < "$state_dir"/rewritten
+	if test -s "$state_dir"/rewritten; then
+		git notes copy --for-rewrite=rebase < "$state_dir"/rewritten
+		if test -x "$GIT_DIR"/hooks/post-rewrite; then
+			"$GIT_DIR"/hooks/post-rewrite rebase < "$state_dir"/rewritten
+		fi
 	fi
 	rm -r "$state_dir"
 	say All done.
-- 
1.7.9.2.263.g07763

             reply	other threads:[~2012-02-25 20:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-25  4:31 Andrew Wong [this message]
2012-02-27  0:01 ` [PATCH] rebase -m: only call "notes copy" when rewritten exists and is non-empty Junio C Hamano

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=1330144282-22540-1-git-send-email-andrew.kw.w@gmail.com \
    --to=andrew.kw.w@gmail.com \
    --cc=git@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).