diff options
author | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-01-06 17:01:48 +0000 |
---|---|---|
committer | Ian Jackson <ijackson@chiark.greenend.org.uk> | 2017-01-06 18:32:14 +0000 |
commit | aabdadcbfdfd7fc158966f9e680e4b04fad41332 (patch) | |
tree | 1c7cf8deb7d3e019725311681e8e05fc8ac21a12 /dgit | |
parent | e9a3ab8ab115a663975026c84332a1d0bdc7264b (diff) |
dgit: Honour dgit-rewrite-map
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
Diffstat (limited to 'dgit')
-rwxr-xr-x | dgit | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -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: |