summaryrefslogtreecommitdiffstats
path: root/bin/git
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-03-01 03:15:23 -0600
committerJesse Luehrs <doy@tozt.net>2012-03-01 04:17:19 -0600
commit474df290790e510bbab958e493f9a611fdfbc855 (patch)
treec212c887b87d82096ffc7bf017501d250d1f727c /bin/git
parent743e6dd917c8a54e9bb3253160a0c7936c5fe333 (diff)
downloadconf-474df290790e510bbab958e493f9a611fdfbc855.tar.gz
conf-474df290790e510bbab958e493f9a611fdfbc855.zip
fix continuing with git rebase-under
Diffstat (limited to 'bin/git')
-rwxr-xr-xbin/git/git-rebase-under11
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/git/git-rebase-under b/bin/git/git-rebase-under
index 7e9c562..7d42584 100755
--- a/bin/git/git-rebase-under
+++ b/bin/git/git-rebase-under
@@ -22,10 +22,11 @@ sub git {
my $git_dir = dir(scalar(git qw(rev-parse --show-toplevel)))->subdir('.git');
my $state_file = $git_dir->file('rebase-under-state');
-my ($onto, $branch, @commits);
+my ($continuing, $onto, $branch, @commits);
if ($ARGV[0] eq '--continue') {
die "can't continue: no state file" unless -r $state_file;
($onto, $branch, @commits) = split("\n", $state_file->slurp);
+ $continuing = 1;
}
else {
$onto = $ARGV[0] // 'master';
@@ -38,7 +39,13 @@ else {
$state_file->openw->print(join("\n", $onto, $branch, @commits));
-git 'checkout', $onto;
+if ($continuing) {
+ git 'commit';
+}
+else {
+ git 'checkout', $onto;
+}
+
while (@commits) {
my $commit = shift @commits;
$state_file->openw->print(join("\n", $onto, $branch, @commits));