Skip to content

Commit

Permalink
rebase-interactive: silence warning when no commits rewritten
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Apr 18, 2010
1 parent f3bd6ab commit 77bc694
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions git-rebase--interactive.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
} &&
Expand Down

0 comments on commit 77bc694

Please sign in to comment.