Skip to content

Commit 77bc694

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f3bd6ab commit 77bc694

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

git-rebase--interactive.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ do_next () {
565565
git diff-tree --stat $(cat "$DOTEST"/head)..HEAD
566566
} &&
567567
{
568+
test -s "$REWRITTEN_LIST" &&
568569
git notes copy --for-rewrite=rebase < "$REWRITTEN_LIST" ||
569570
true # we don't care if this copying failed
570571
} &&

0 commit comments

Comments
 (0)