diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-10-30 21:04:22 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2016-10-30 22:46:35 +0000 |
commit | 4723806663cc562af68cb68a9f0c18548942bad8 (patch) | |
tree | 7b643993f43a2e975ae1742c0d0afbd5d72c6ca3 /dgit | |
parent | 6d8d98477ba6f9046d3e3f7561777ecd7ead1e23 (diff) |
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 <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 8 |
1 files changed, 3 insertions, 5 deletions
@@ -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 <<END or die $!; @@ -2742,7 +2739,8 @@ END die "$lasth $hash $what ?" unless is_fast_fwd($lasth, $hash); }; - $chkff->($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", |