Skip to content
This repository was archived by the owner on Jul 24, 2020. It is now read-only.
This repository was archived by the owner on Jul 24, 2020. It is now read-only.

dulwich.errors.RefFormatError when refname includes one of chars in BAD_REF_CHARS #330

@reynoldsnlp

Description

@reynoldsnlp

As discussed here, hg-git runs into a dulwich.errors.RefFormatError when the refname includes a character in BAD_REF_CHARS (refs.py).

The suggestion is to have hg-git mangle/replace BAD_REF_CHARS with other characters. This should be very simple with something like...

from string import maketrans
bad2good = maketrans(BAD_REF_CHARS, b'ABCDEFGH')  # or replace [A-H] with something more meaningful
refname = refname.translate(bad2good)

I would be happy to submit a pull request, but I need help to determine where this should be done.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions