Skip to content

Braces in Remote Branch Names Are Truncated #366

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
crbunney opened this issue Nov 25, 2015 · 1 comment
Open

Braces in Remote Branch Names Are Truncated #366

crbunney opened this issue Nov 25, 2015 · 1 comment

Comments

@crbunney
Copy link

I've found that remote refs that contain braces are truncated when inspected using GitPython. This doesn't seem to affect local refs. I constructed a contrived example to demonstrate:

Python version (python --version): Python 2.7.6
GitPython version (python -c 'import git; print git.__version__'): 1.0.1

Test Code:

import git
r = git.Repo('/tmp/testrepo')
origin = r.create_remote('origin', 'file:///tmp/testorigin')
for r in origin.fetch():
    print r

Actual Output:

origin/master
origin/test
origin/test
origin/test

Expected Output:

origin/master
origin/test{test
origin/test{test}test
origin/test}test

Test Setup:

mkdir -p /tmp/testrepo
cd /tmp/testrepo
git init
touch foo.txt
git add foo.txt
git commit -a -m 'testrepo initial commit'
git checkout -b test{branch}with_braces

mkdir -p /tmp/testorigin
cd /tmp/testorigin
git init
touch bar.txt
git add bar.txt
git commit -a -m 'testorigin initial commit'
git checkout -b test{test}test
git checkout -b test{test
git checkout -b test}test
@Byron Byron added this to the v1.0.2 - Fixes milestone Nov 30, 2015
@Byron
Copy link
Member

Byron commented Nov 30, 2015

Thanks for letting me know ! Apparently the parser consuming the output of git fetch doesn't work correctly ... might be this regular expression that assumes there must only be alphanumeric characters in the paths. Similar problems might occour with unicode characters, I assume, thus when this one is fixed, another test for the latter could be in order.

@Byron Byron modified the milestones: v1.0.2 - Fixes, v1.0.3 - Fixes Feb 13, 2016
@Byron Byron modified the milestones: v2.0.0 - Features and Fixes, v2.0.1 - Bugfixes Apr 24, 2016
@Byron Byron removed this from the v2.0.7 - Bugfixes milestone Jul 17, 2016
@Byron Byron modified the milestones: v2.0.9 - Bugfixes, v2.0.10 - Bugfixes, v2.1.0 - proper windows support, v2.1.0 - better windows support, v2.1.1 - Bugfixes Oct 16, 2016
@Byron Byron modified the milestones: v2.1.1 - Bugfixes, v2.1.2 - Bugfixes Dec 8, 2016
@Byron Byron modified the milestones: v2.1.2 - Bugfixes, v2.1.3 - Bugfixes Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants