X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=dgit;h=555e1c00905f30f0da4c18f54ac40c39b8d59ae8;hp=9d3584fb7e0abd96b420e70a3f24def0b78ee20e;hb=d93bea01f0863c3fa84a3dea79cb9076dcfd4ff5;hpb=f773b1ed2796196e0fa801886fce493544c38fe0 diff --git a/dgit b/dgit index 9d3584fb..555e1c00 100755 --- a/dgit +++ b/dgit @@ -96,6 +96,7 @@ our $orig_f_tail_re = "$orig_f_comp_re\\.tar(?:\\.\\w+)?(?:$orig_f_sig_re)?"; our $git_authline_re = '^([^<>]+) \<(\S+)\> (\d+ [-+]\d+)$'; our $splitbraincache = 'dgit-intern/quilt-cache'; +our $rewritemap = 'dgit-rewrite/map'; our (@git) = qw(git); our (@dget) = qw(dget); @@ -2513,6 +2514,7 @@ sub git_fetch_us () { \&debiantag_new, \&debiantag_maintview) : debiantags('*',access_nomdistro)); push @specs, server_branch($csuite); + push @specs, $rewritemap; push @specs, qw(heads/*) if deliberately_not_fast_forward; # This is rather miserable: @@ -2724,6 +2726,18 @@ sub fetch_from_archive () { progress "no version available from the archive"; } + my $rewritemapdata = git_cat_file lrfetchrefs."/".$rewritemap.':map'; + if (defined $rewritemapdata + && $rewritemapdata =~ m/^$dsc_hash(?:[ \t](\w+))/m) { + progress "server's git history rewrite map contains a relevant entry!"; + $dsc_hash = $1; + if (defined $dsc_hash) { + progress "using rewritten git hash in place of .dsc value"; + } else { + progress "server data says .dsc hash is to be disregarded"; + } + } + # If the archive's .dsc has a Dgit field, there are three # relevant git commitids we need to choose between and/or merge # together: