You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GitPython seems to have trouble with branch names that contain the ] character. It's probably a bad idea to use this character in a branch name, but it seems to be legal in principle, according to https://git-scm.com/docs/git-check-ref-format.
The problem can be reproduced as follows: Create a bare git repository with a branch named example] and run
The clone itself succeeds. However, when I navigate to the resulting cloned repository test-cloned-repository, I observe that the .git/config is faulty, since it contains the entry
the clone works properly and the config line correctly reads
[branch "example]"]
These observations were made with Python 3.9.15, git version 2.34.1 and GitPython==3.1.30.
So far, I couldn't spot the point in the GitPython code that causes this issue.
Thanks in advance and best regards
Dominik
The text was updated successfully, but these errors were encountered:
I think it happens in this line as it meddles with the URL of the remote. This is where it re-writes the config and does so wrongly. The reason for this most certainly is that GitPython abuses an INI parser, which is correct only superficially.
This bug is most certainly just the tip of the iceberg when it comes to correctness (or the lack thereof).
Hi everyone,
GitPython seems to have trouble with branch names that contain the
]
character. It's probably a bad idea to use this character in a branch name, but it seems to be legal in principle, according to https://git-scm.com/docs/git-check-ref-format.The problem can be reproduced as follows: Create a bare git repository with a branch named
example]
and runI get the following debug output:
The clone itself succeeds. However, when I navigate to the resulting cloned repository
test-cloned-repository
, I observe that the.git/config
is faulty, since it contains the entryConsequently, git commands fail with
fatal: bad config line 9 in file .git/config
.If I, instead, run the corresponding command from the console without using GitPython
the clone works properly and the config line correctly reads
These observations were made with Python 3.9.15, git version 2.34.1 and GitPython==3.1.30.
So far, I couldn't spot the point in the GitPython code that causes this issue.
Thanks in advance and best regards
Dominik
The text was updated successfully, but these errors were encountered: