From ad687b447a87efaf61c39075da2ef81b85715186 Mon Sep 17 00:00:00 2001 From: Andrew Wong Date: Fri, 24 Feb 2012 23:31:22 -0500 Subject: [PATCH] rebase -m: only call "notes copy" when rewritten exists and is non-empty This prevents a shell error complaining rebase-merge/rewritten doesn't exist. Signed-off-by: Andrew Wong Signed-off-by: Junio C Hamano --- git-rebase--merge.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/git-rebase--merge.sh b/git-rebase--merge.sh index 26afc75cc..dc599077f 100644 --- a/git-rebase--merge.sh +++ b/git-rebase--merge.sh @@ -90,10 +90,13 @@ 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. -- 2.26.2