summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2019-05-20 21:55:06 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2019-06-28 12:45:38 +0100
commit9dd8836fb53b8d37db646b28d6ae94b052130736 (patch)
tree69f51609137b0b647d544db8d36af6e69929970c
parent29302373129946046c6b461103d12f6b6bf9f908 (diff)
dgit: Move quiltify_splitbrain_needed into its one call site
I think $split_brain is always 0 on entry. It is this quiltify_splitbrain which used to calculate whether actually splitting brain was needed based on the quilt mode and the state of the tree. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xdgit11
1 files changed, 3 insertions, 8 deletions
diff --git a/dgit b/dgit
index 99bd51a..97557ce 100755
--- a/dgit
+++ b/dgit
@@ -5374,13 +5374,6 @@ sub quiltify_tree_sentinelfiles ($) {
return $r;
}
-sub quiltify_splitbrain_needed () {
- if (!$split_brain) {
- runcmd @git, qw(checkout -q -b dgit-view);
- $split_brain = 1;
- }
-}
-
sub quiltify_splitbrain ($$$$$$$) {
my ($clogp, $unapplied, $headref, $oldtiptree, $diffbits,
$editedignores, $cachekey) = @_;
@@ -5400,7 +5393,9 @@ sub quiltify_splitbrain ($$$$$$$) {
local $ENV{GIT_AUTHOR_EMAIL} = $authline[1];
local $ENV{GIT_AUTHOR_DATE} = $authline[2];
- quiltify_splitbrain_needed();
+ die if $split_brain;
+ runcmd @git, qw(checkout -q -b dgit-view);
+ $split_brain = 1;
my $fulldiffhint = sub {
my ($x,$y) = @_;