summaryrefslogtreecommitdiff
path: root/dgit
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2018-07-04 01:21:43 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2018-07-04 01:56:59 +0100
commit66d6b40a1474ef84fe0e4a68bd7428f5ab1b0e31 (patch)
tree803e7f23930bedb6adba189ccd9fd71424bea6bc /dgit
parent8a52fe8f9f3fc66be492c54a19e2ba7890aa0557 (diff)
dgit: fetch: Introduce new dofetch()
This actually does all that is needed. It replaces two now-identical calling patterns. Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-xdgit10
1 files changed, 6 insertions, 4 deletions
diff --git a/dgit b/dgit
index 5efcc5b..c7336dd 100755
--- a/dgit
+++ b/dgit
@@ -3738,10 +3738,14 @@ END
printdone "fetched into ".lrref();
}
-sub pull () {
+sub dofetch () {
my $multi_fetched = fork_for_multisuite(sub { });
fetch_one() unless $multi_fetched; # parent
finish 0 if $multi_fetched eq '0'; # child
+}
+
+sub pull () {
+ dofetch();
runcmd_ordryrun_local @git, qw(merge -m),"Merge from $csuite [dgit]",
lrref();
printdone "fetched to ".lrref()." and merged into HEAD";
@@ -4624,9 +4628,7 @@ sub fetchpullargs () {
sub cmd_fetch {
parseopts();
fetchpullargs();
- my $multi_fetched = fork_for_multisuite(sub { });
- fetch_one() unless $multi_fetched; # parent
- finish 0 if $multi_fetched eq '0'; # child
+ dofetch();
}
sub cmd_pull {