The documentation contains a recipe for how to emulate git clone --mirror. In
the example code, the init_remote callback constructs the mirror configuration
passing name to str.format. However, the callback receives the name (and
url) as bytes, so str.format would return something like this:
"remote.b'origin'.mirror"
This commit fixes the code example by decoding name when used with str.format.
The invocation of repo.remotes.create in the same example works fine as is,
because that function invokes to_bytes on its arguments, and to_bytes is a
noop when passed bytes.
The documentation contains a recipe for how to emulate
git clone --mirror
. In the example code, the init_remote callback constructs the mirror configuration passingname
to str.format. However, the callback receives thename
(andurl
) as bytes, so str.format would return something like this:This commit fixes the code example by decoding
name
when used with str.format.The invocation of
repo.remotes.create
in the same example works fine as is, because that function invokesto_bytes
on its arguments, andto_bytes
is a noop when passed bytes.