[PATCH] rebase -p -i: handle "no changes" gracefully

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Since commit 376ccb8cbb453343998e734d8a1ce79f57a4e092, unchanged
SHA-1s are no longer mapped via $REWRITTEN.  But the updating
phase was not prepared for the old head not being rewritten.

Signed-off-by: Johannes Schindelin <johannes.schindelin@xxxxxx>
---

	On Mon, 17 Dec 2007, Pieter de Bie wrote:

	> Ok, but what about the error in the rebase?
	> 
	> On Dec 14, 2007, at 2:21 AM, Pieter de Bie wrote:
	> > Tirana:~/git pieter$ time git rebase -p -i HEAD~100
	> > cat:
	> > /Users/pieter/git/.git/.dotest-merge/rewritten/1e8df762b38e01685f3aa3613e2d61f73346fcbe:
	> > No such file or directory

	This buglet was not caught earlier, probably because a 
	non-rewriting rebase is not really interesting ;-)

 git-rebase--interactive.sh |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh
index f83e00f..cd7e43f 100755
--- a/git-rebase--interactive.sh
+++ b/git-rebase--interactive.sh
@@ -322,7 +322,12 @@ do_next () {
 		test -f "$DOTEST"/current-commit &&
 			current_commit=$(cat "$DOTEST"/current-commit) &&
 			git rev-parse HEAD > "$REWRITTEN"/$current_commit
-		NEWHEAD=$(cat "$REWRITTEN"/$OLDHEAD)
+		if test -f "$REWRITTEN"/$OLDHEAD
+		then
+			NEWHEAD=$(cat "$REWRITTEN"/$OLDHEAD)
+		else
+			NEWHEAD=$OLDHEAD
+		fi
 	else
 		NEWHEAD=$(git rev-parse HEAD)
 	fi &&
-- 
1.5.4.rc0.59.g1d10d

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux