git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rebase -m: only call "notes copy" when rewritten exists and is non-empty
@ 2012-02-25  4:31 Andrew Wong
  2012-02-27  0:01 ` Junio C Hamano
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Wong @ 2012-02-25  4:31 UTC (permalink / raw)
  To: git; +Cc: Andrew Wong

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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rebase -m: only call "notes copy" when rewritten exists and is non-empty
  2012-02-25  4:31 [PATCH] rebase -m: only call "notes copy" when rewritten exists and is non-empty Andrew Wong
@ 2012-02-27  0:01 ` Junio C Hamano
  0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2012-02-27  0:01 UTC (permalink / raw)
  To: Andrew Wong; +Cc: git

Andrew Wong <andrew.kw.w@gmail.com> writes:

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

Yeah, the updated logic overall makes more sense, too.  "when we have
rewritten, then we do these two things" is clear from the text.

Thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-02-27  0:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-25  4:31 [PATCH] rebase -m: only call "notes copy" when rewritten exists and is non-empty Andrew Wong
2012-02-27  0:01 ` Junio C Hamano

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).