From: Jeff King Date: Sun, 18 Apr 2010 12:01:45 +0000 (-0400) Subject: rebase-interactive: silence warning when no commits rewritten X-Git-Tag: v1.7.1-rc2~7 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=77bc694907bdf517407cc6f79da8adf9a4879cea;p=git.git 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 --- diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index b817c4a76..436b7f597 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 } &&