chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9bab0fa
)
git-debrebase: introduce ffq_prev_info (nfc)
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Thu, 5 Apr 2018 19:20:30 +0000
(20:20 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 16 Jun 2018 15:07:01 +0000
(16:07 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
git-debrebase
patch
|
blob
|
history
diff --git
a/git-debrebase
b/git-debrebase
index 866b0ded6cfe06bc30469ca01935f805b62f306d..00e55884abeb67a1dc676b3ad8ec67eee5311931 100755
(executable)
--- a/
git-debrebase
+++ b/
git-debrebase
@@
-1032,6
+1032,18
@@
sub record_ffq_auto () {
}
}
}
}
+sub ffq_prev_info () {
+ # => ($ffq_prev, $gdrlast, $ffq_prev_commitish)
+ my ($status, $message, $current, $ffq_prev, $gdrlast)
+ = ffq_prev_branchinfo();
+ if ($status ne 'branch') {
+ fproblem $status, "could not check ffq-prev: $message";
+ fproblems_maybe_bail();
+ }
+ my $ffq_prev_commitish = $ffq_prev && git_get_ref $ffq_prev;
+ return ($ffq_prev, $gdrlast, $ffq_prev_commitish);
+}
+
sub stitch ($$$$$) {
my ($old_head, $ffq_prev, $gdrlast, $ffq_prev_commitish, $prose) = @_;
sub stitch ($$$$$) {
my ($old_head, $ffq_prev, $gdrlast, $ffq_prev_commitish, $prose) = @_;
@@
-1273,13
+1285,8
@@
sub cmd_stitch () {
my $prose = '';
GetOptions('prose=s', \$prose) or die badusage("bad options to stitch");
badusage "no arguments allowed" if @ARGV;
my $prose = '';
GetOptions('prose=s', \$prose) or die badusage("bad options to stitch");
badusage "no arguments allowed" if @ARGV;
- my ($status, $message, $current, $ffq_prev, $gdrlast)
- = ffq_prev_branchinfo();
- if ($status ne 'branch') {
- fproblem $status, "could not check ffq-prev: $message";
- fproblems_maybe_bail();
- }
- my $ffq_prev_commitish = $ffq_prev && git_get_ref $ffq_prev;
+
+ my ($ffq_prev, $gdrlast, $ffq_prev_commitish) = ffq_prev_info();
if (!$ffq_prev_commitish) {
fail "No ffq-prev to stitch." unless $opt_noop_ok;
return;
if (!$ffq_prev_commitish) {
fail "No ffq-prev to stitch." unless $opt_noop_ok;
return;