X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=a9fab5e19fe1c7a97d2726f219da65401d255438;hp=759df20e5df761a58e05418538283e48003ebb07;hb=013cc5ea30f13c2ea3be8851a34efe7fd6af2eae;hpb=fb73b55ade7687b65727b1146b860ea892425cc6 diff --git a/dgit b/dgit index 759df20e..a9fab5e1 100755 --- a/dgit +++ b/dgit @@ -52,7 +52,7 @@ our $new_package = 0; our $ignoredirty = 0; our $rmonerror = 1; our @deliberatelies; -our %supersedes; +our %previously; our $existing_package = 'dpkg'; our $cleanmode = 'dpkg-source'; our $changes_since_version; @@ -111,6 +111,8 @@ sub lref () { return "refs/heads/".lbranch(); } sub lrref () { return "refs/remotes/$remotename/".server_branch($csuite); } sub rrref () { return server_ref($csuite); } +sub lrfetchrefs () { return "refs/dgit-fetch/$isuite"; } + sub stripepoch ($) { my ($vsn) = @_; $vsn =~ s/^\d+\://; @@ -162,6 +164,12 @@ sub deliberately ($) { return !!grep { $_ eq "--deliberately-$enquiry" } @deliberatelies; } +sub deliberately_not_fast_forward () { + foreach (qw(not-fast-forward fresh-repo)) { + return 1 if deliberately($_) || deliberately("TEST-dgit-only-$_"); + } +} + #---------- remote protocol support, common ---------- # remote push initiator/responder protocol: @@ -1256,6 +1264,11 @@ sub ensure_we_have_orig () { sub git_fetch_us () { runcmd_ordryrun_local @git, qw(fetch),access_giturl(),fetchspec(); + if (deliberately_not_fast_forward) { + runcmd_ordryrun_local @git, qw(fetch -p), access_giturl(), + map { "+refs/$_/*:".lrfetchrefs."/$_/*" } + qw(tags heads); + } } sub fetch_from_archive () { @@ -1529,9 +1542,9 @@ tagger $authline $package release $cversion for $clogsuite ($csuite) [dgit] [dgit distro=$declaredistro$delibs] END - foreach my $ref (sort keys %supersedes) { + foreach my $ref (sort keys %previously) { print TO <