summaryrefslogtreecommitdiff
path: root/git-debrebase
diff options
context:
space:
mode:
Diffstat (limited to 'git-debrebase')
-rwxr-xr-xgit-debrebase16
1 files changed, 16 insertions, 0 deletions
diff --git a/git-debrebase b/git-debrebase
index 4046425..f4831c3 100755
--- a/git-debrebase
+++ b/git-debrebase
@@ -975,6 +975,18 @@ sub update_head_postlaunder ($$$) {
runcmd @git, qw(rm --quiet --ignore-unmatch -rf debian/patches);
}
+sub currently_rebasing() {
+ foreach (qw(rebase-merge rebase-apply)) {
+ return 1 if stat_exists "$maindir_gitdir/$_";
+ }
+ return 0;
+}
+
+sub bail_if_rebasing() {
+ fail "you are in the middle of a git-rebase already"
+ if currently_rebasing();
+}
+
sub do_launder_head ($) {
my ($reflogmsg) = @_;
my $old = get_head();
@@ -1114,6 +1126,7 @@ sub record_ffq_prev_deferred () {
# if "deferred", will have added something about that to
# @deferred_update_messages, and also maybe printed (already)
# some messages about ff checks
+ bail_if_rebasing();
my $currentval = get_head();
my ($status,$message, $ffq_prev,$gdrlast) = ffq_check $currentval;
@@ -1137,6 +1150,7 @@ sub record_ffq_auto () {
}
sub ffq_prev_info () {
+ bail_if_rebasing();
# => ($ffq_prev, $gdrlast, $ffq_prev_commitish)
my ($status, $message, $current, $ffq_prev, $gdrlast)
= ffq_prev_branchinfo();
@@ -1547,6 +1561,7 @@ sub cmd_status () {
print " not git-debrebase (diverged since last stitch)\n"
}
}
+ print "you are currently rebasing\n" if currently_rebasing();
}
sub cmd_stitch () {
@@ -1633,6 +1648,7 @@ sub cmd_make_patches () {
getoptions("make-patches",
'quiet-would-amend!', \$opt_quiet_would_amend);
badusage "no arguments allowed" if @ARGV;
+ bail_if_rebasing();
my $old_head = get_head();
my $new = make_patches $old_head;
my $d = get_differs $old_head, $new;