GitRepository.set_upstream_branch: Newer git wants a valid remote repo entry
authorGuido Günther <agx@sigxcpu.org>
Thu, 4 Jul 2013 15:36:33 +0000 (17:36 +0200)
committerGuido Günther <agx@sigxcpu.org>
Thu, 4 Jul 2013 15:51:38 +0000 (17:51 +0200)
so set one in the tests before trying to set the upstream branch.

Found with git 1.8.3.2

tests/test_GitRepository.py

index 0e8d8d0..8dafc2a 100644 (file)
@@ -186,6 +186,7 @@ def test_set_upstream_branch():
     >>> os.makedirs(os.path.join(repo.git_dir, 'refs/remotes/origin'))
     >>> shutil.copy(os.path.join(repo.git_dir, 'refs/heads/master'), \
                     os.path.join(repo.git_dir, 'refs/remotes/origin/'))
+    >>> repo.add_remote_repo('origin', 'git://git.example.com/git/origin')
     >>> repo.set_upstream_branch('master', 'origin/master')
     >>> repo.get_upstream_branch('master')
     'origin/master'
@@ -195,7 +196,6 @@ def test_set_upstream_branch():
     >>> repo.set_upstream_branch('foo', 'origin/bla')
     Traceback (most recent call last):
     GitRepositoryError: Branch origin/bla doesn't exist!
-
     """
 
 def test_get_upstream_branch():