filter-repo: prepend the header line to the "ref-map" file

The existance of a header has already been specified in the documentation.
Further adapt it to the real text implemented now.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
pull/327/head
Markus Heidelberg 2 years ago
parent fff5f43a15
commit 3fe2b5c3c9

@ -382,7 +382,7 @@ Reference map
The `.git/filter-repo/ref-map` file contains a mapping of which local
references were changed.
* A header is the first line with the text "old" and "new"
* A header is the first line with the text "old", "new" and "ref"
* Reference mappings are in no particular order
* An all-zeros hash, or null SHA, represents a non-existant object.
When in the "new" column, this means the ref was removed entirely.

@ -3811,6 +3811,7 @@ class RepoFilter(object):
batch_check_process = None
batch_check_output_re = re.compile(b'^([0-9a-f]{40}) ([a-z]+) ([0-9]+)$')
with open(os.path.join(metadata_dir, b'ref-map'), 'bw') as f:
f.write(("%-40s %-40s %s\n" % (_("old"), _("new"), _("ref"))).encode())
for refname, old_hash in orig_refs.items():
if refname not in exported_refs:
continue

Loading…
Cancel
Save