Skip to content

Commit

Permalink
git/rebase: don't reset the branch when resuming a rebase
Browse files Browse the repository at this point in the history
Otherwise, we lose any previous progress with the rebase.

Since we no longer need $dst when resuming, don't bother keeping track
of it.
  • Loading branch information
michaelforney committed Feb 1, 2021
1 parent f12b5c3 commit bd922f0
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions rebase
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ if(~ $#abort 1){
if(! test -f .git/rebase.todo)
die no rebase to abort
src=`{cat .git/rebase.src}
rm -f .git/rebase.^(src dst todo)
rm -f .git/rebase.^(src todo)
git/branch $src
git/branch -d $tmp
exit
Expand All @@ -24,7 +24,6 @@ if(test -f .git/rebase.todo){
if(! ~ $#* 0)
exec aux/usage
src=`{cat .git/rebase.src}
dst=`{cat .git/rebase.dst}
commits=`{cat .git/rebase.todo}
}
if not{
Expand All @@ -34,15 +33,14 @@ if not{
dst=`{git/query $1}
commits=`{git/query -r $dst $src @ .. $src}
## TODO: edit $commits here for -i
git/branch -nb $dst $tmp
}
git/branch -nb $dst $tmp
while(! ~ $#commits 0){
c=$commits(1)
commits=$commits(2-)
if(! git/export $c | git/import){
echo $src > .git/rebase.src
echo $dst > .git/rebase.dst
echo $commits > .git/rebase.todo
die $c: fix and git/rebase -r
}
Expand Down

0 comments on commit bd922f0

Please sign in to comment.