From 18c4fddd4c69c6c2bf225ded6c5cc2ff060e96b6 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 8 Jan 2017 00:50:02 +0000 Subject: [PATCH] git fetching: Break out git_lrfetch_sane No functional change. Signed-off-by: Ian Jackson --- dgit | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/dgit b/dgit index 933c0082..dc31ce17 100755 --- a/dgit +++ b/dgit @@ -2507,19 +2507,8 @@ sub ensure_we_have_orig () { } } -sub git_fetch_us () { - # Want to fetch only what we are going to use, unless - # deliberately-not-ff, in which case we must fetch everything. - - my @specs = deliberately_not_fast_forward ? qw(tags/*) : - map { "tags/$_" } - (quiltmode_splitbrain - ? (map { $_->('*',access_nomdistro) } - \&debiantag_new, \&debiantag_maintview) - : debiantags('*',access_nomdistro)); - push @specs, server_branch($csuite); - push @specs, $rewritemap; - push @specs, qw(heads/*) if deliberately_not_fast_forward; +sub git_lrfetch_sane { + my (@specs) = @_; # This is rather miserable: # When git fetch --prune is passed a fetchspec ending with a *, @@ -2650,6 +2639,23 @@ END } printdebug "git_fetch_us: git fetch --no-insane emulation complete\n", Dumper(\%lrfetchrefs_f); +} + +sub git_fetch_us () { + # Want to fetch only what we are going to use, unless + # deliberately-not-ff, in which case we must fetch everything. + + my @specs = deliberately_not_fast_forward ? qw(tags/*) : + map { "tags/$_" } + (quiltmode_splitbrain + ? (map { $_->('*',access_nomdistro) } + \&debiantag_new, \&debiantag_maintview) + : debiantags('*',access_nomdistro)); + push @specs, server_branch($csuite); + push @specs, $rewritemap; + push @specs, qw(heads/*) if deliberately_not_fast_forward; + + git_lrfetch_sane @specs; my %here; my @tagpats = debiantags('*',access_nomdistro); -- 2.30.2