rebase: extract code for writing basic state
commit84df4560ed92a771d38081ecca2d40ca35811907
authorMartin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Sun, 6 Feb 2011 18:43:53 +0000 (6 13:43 -0500)
committerJunio C Hamano <gitster@pobox.com>
Thu, 10 Feb 2011 22:08:09 +0000 (10 14:08 -0800)
treea7866155495fcfa738b9748722c87651c28a5bc7
parent2959c283662c62e90d08d3795073534f278deee6
rebase: extract code for writing basic state

Extract the code for writing the state to rebase-apply/ or
rebase-merge/ when a rebase is initiated. This will make it easier to
later make both interactive and non-interactive rebase remember the
options used.

Note that non-interactive rebase stores the sha1 of the original head
in a file called orig-head, while interactive rebase stores it in a
file called head. Change this by writing to orig-head in both
cases. When reading, try to read from orig-head. If that fails, read
from head instead. This protects users who upgraded git while they had
an ongoing interactive rebase, while still making it possible to
remove the code that reads from head at some point in the future.

Helped-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-rebase--am.sh
git-rebase--interactive.sh
git-rebase--merge.sh
git-rebase.sh