From: Ian Jackson Date: Sun, 30 Oct 2016 21:04:22 +0000 (+0000) Subject: Cope when cloning suite which doesn't receive uploads, like testing. X-Git-Tag: archive/debian/2.9~22 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;ds=sidebyside;h=4723806663cc562af68cb68a9f0c18548942bad8;p=dgit.git Cope when cloning suite which doesn't receive uploads, like testing. If $lastpush_hash is '', it means that the dgit git server does not have the suite branch. That can even happen if the current version in the suite was a .dsc with a Dgit field, if an in-archive copy moved the .dsc from whereever it was uploaded. Do not crash in this situation. Instead, give the user the Dgit hash (and maybe pseudomerge it with the user's history - sigh). There is still a possible problem: maybe the referenced commit is on another branch. Signed-off-by: Ian Jackson --- diff --git a/debian/changelog b/debian/changelog index cc4d4c0d..19a1a9f7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,8 @@ dgit (2.9~) unstable; urgency=low * Reject `dgit pull' in split view quilt modes, to avoid creating unfortunate wreckage on non-dgit-view branches. Closes:#842608. + * Cope when cloning suite which doesn't receive uploads, + like testing. Closes:#842621. -- diff --git a/dgit b/dgit index e4eba536..2a2eeddb 100755 --- a/dgit +++ b/dgit @@ -2571,11 +2571,8 @@ sub fetch_from_archive () { }; if (defined $dsc_hash) { - fail "missing remote git history even though dsc has hash -". - " could not find ref ".rref()." at ".access_giturl() - unless $lastpush_hash; ensure_we_have_orig(); - if ($dsc_hash eq $lastpush_hash) { + if (!$lastpush_hash || $dsc_hash eq $lastpush_hash) { @mergeinputs = $dsc_mergeinput } elsif (is_fast_fwd($dsc_hash,$lastpush_hash)) { print STDERR <($lastpush_hash, 'dgit repo server tip (last push)'); + $chkff->($lastpush_hash, 'dgit repo server tip (last push)') + if $lastpush_hash; $chkff->($lastfetch_hash, 'local tracking tip (last fetch)'); runcmd @git, qw(update-ref -m), "dgit fetch $csuite",