summaryrefslogtreecommitdiff
path: root/git/test/test_remote.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2015-01-22 15:22:39 +0100
committerSebastian Thiel <byronimo@gmail.com>2015-01-22 15:22:39 +0100
commit06bec1bcd1795192f4a4a274096f053afc8f80ec (patch)
treefda896da0f7406ff257b8f9d1d3805965bc94311 /git/test/test_remote.py
parentb54b9399920375f0bab14ff8495c0ea3f5fa1c33 (diff)
downloadgitpython-06bec1bcd1795192f4a4a274096f053afc8f80ec.tar.gz
Fetch now deals with custom refspecs much better.
Even though the test-csae only verifies this spec: +refs/pull/*:refs/heads/pull/* I could locally verify that it indeed handles other ones just as well: +refs/pull/*:refs/pull/* Fixes #243
Diffstat (limited to 'git/test/test_remote.py')
-rw-r--r--git/test/test_remote.py16
1 files changed, 15 insertions, 1 deletions
diff --git a/git/test/test_remote.py b/git/test/test_remote.py
index d4a92ed4..4fd78230 100644
--- a/git/test/test_remote.py
+++ b/git/test/test_remote.py
@@ -7,7 +7,8 @@
from git.test.lib import (
TestBase,
with_rw_repo,
- with_rw_and_rw_remote_repo
+ with_rw_and_rw_remote_repo,
+ fixture
)
from git import (
RemoteProgress,
@@ -520,3 +521,16 @@ class TestRemote(TestBase):
assert type(fi.ref) is Reference
assert fi.ref.path == "refs/something/branch"
+
+ def test_uncommon_branch_names(self):
+ stderr_lines = fixture('uncommon_branch_prefix_stderr').decode('ascii').splitlines()
+ fetch_lines = fixture('uncommon_branch_prefix_FETCH_HEAD').decode('ascii').splitlines()
+
+ # The contents of the files above must be fetched with a custom refspec:
+ # +refs/pull/*:refs/heads/pull/*
+ res = [FetchInfo._from_line('ShouldntMatterRepo', stderr, fetch_line)
+ for stderr, fetch_line in zip(stderr_lines, fetch_lines)]
+ assert len(res)
+ assert res[0].remote_ref_path == 'refs/pull/1/head'
+ assert res[0].ref.path == 'refs/heads/pull/1/head'
+ assert isinstance(res[0].ref, Head)