From: Andrew Wong Date: Sat, 25 Feb 2012 04:31:22 +0000 (-0500) Subject: rebase -m: only call "notes copy" when rewritten exists and is non-empty X-Git-Tag: v1.7.8.5~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ad687b447a87efaf61c39075da2ef81b85715186;p=git.git 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 --- 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.