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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Apr 18, 2010 at 08:01 UTC
77bc694907bdf517407cc6f79da8adf9a4879cea
1 file changed
+1
git-rebase--interactive.sh
+1
@@ -565,6 +565,7 @@ do_next () {
565
git diff-tree --stat $(cat "$DOTEST"/head)..HEAD
566
} &&
567
{
568
+ test -s "$REWRITTEN_LIST" &&
569
git notes copy --for-rewrite=rebase < "$REWRITTEN_LIST" ||
570
true # we don't care if this copying failed
571
} &&