diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-06-10 16:59:00 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-06-10 16:59:00 +0200 |
commit | 4a771adc5352dd3876dd2ef3d0c52c8e803fc084 (patch) | |
tree | dca5577bdaa85991d92b9b7e9f6b484837c140ff /git/test/test_remote.py | |
parent | 982eefb2008826604d54c1a6622c12240efb0961 (diff) | |
download | gitpython-4a771adc5352dd3876dd2ef3d0c52c8e803fc084.tar.gz |
fix(remote): assert fetch respec is set
It turns out we can't deal do fetches if no refspec is set as git
will change the format of the fetch return values, providing less
information than usual.
A test was added to show that such a case will fail, and an assertion
will assure we don't attempt to fetch/pull if there is no refspec
for 'fetch'.
Closes #296
Diffstat (limited to 'git/test/test_remote.py')
-rw-r--r-- | git/test/test_remote.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/git/test/test_remote.py b/git/test/test_remote.py index af854988..6c37614d 100644 --- a/git/test/test_remote.py +++ b/git/test/test_remote.py @@ -494,6 +494,11 @@ class TestRemote(TestBase): fetch_info_line_fmt = "c437ee5deb8d00cf02f03720693e4c802e99f390 not-for-merge %s '0.3' of " fetch_info_line_fmt += "git://github.com/gitpython-developers/GitPython" remote_info_line_fmt = "* [new branch] nomatter -> %s" + + self.failUnlessRaises(ValueError, FetchInfo._from_line, self.rorepo, + remote_info_line_fmt % "refs/something/branch", + "269c498e56feb93e408ed4558c8138d750de8893\t\t/Users/ben/test/foo\n") + fi = FetchInfo._from_line(self.rorepo, remote_info_line_fmt % "local/master", fetch_info_line_fmt % 'remote-tracking branch') |