From 77bc694907bdf517407cc6f79da8adf9a4879cea Mon Sep 17 00:00:00 2001 From: Jeff King Date: Sun, 18 Apr 2010 08:01:45 -0400 Subject: [PATCH] rebase-interactive: silence warning when no commits rewritten If you do a "rebase -i" and don't change any commits, nothing is rewritten, and we have no REWRITTEN_LIST. The shell prints out an ugly message: $ GIT_EDITOR=true git rebase -i HEAD^ /path/to/git-rebase--interactive: 1: cannot open /path/to/repo/.git/rebase-merge/rewritten-list: No such file Successfully rebased and updated refs/heads/master. We can fix it by not running "notes copy" at all if nothing was rewritten. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- git-rebase--interactive.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index b817c4a76e..436b7f5977 100755 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -565,6 +565,7 @@ do_next () { git diff-tree --stat $(cat "$DOTEST"/head)..HEAD } && { + test -s "$REWRITTEN_LIST" && git notes copy --for-rewrite=rebase < "$REWRITTEN_LIST" || true # we don't care if this copying failed } && -- 2.11.4.GIT