summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominic <yobmod@gmail.com>2021-07-31 13:05:19 +0100
committerGitHub <noreply@github.com>2021-07-31 13:05:19 +0100
commit1a360c8c1aa552e9674e1a6d6b1b1e4aacac3c2e (patch)
tree353e5f7d0ea8cc1f315eec93fada5b74f305c720
parent9110b98eb5e2fa064a5e63b91ff49c1325b62cbe (diff)
downloadgitpython-1a360c8c1aa552e9674e1a6d6b1b1e4aacac3c2e.tar.gz
Update test_refs.py
-rw-r--r--test/test_refs.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/test_refs.py b/test/test_refs.py
index 1315f885..ab760a6f 100644
--- a/test/test_refs.py
+++ b/test/test_refs.py
@@ -125,11 +125,15 @@ class TestRefs(TestBase):
gp_tracking_branch = rwrepo.create_head('gp_tracking#123')
special_name_remote_ref = rwrepo.remotes[0].refs[special_name] # get correct type
gp_tracking_branch.set_tracking_branch(special_name_remote_ref)
- assert gp_tracking_branch.tracking_branch().path == special_name_remote_ref.path
+ TBranch = gp_tracking_branch.tracking_branch()
+ if TBranch is not None:
+ assert TBranch.path == special_name_remote_ref.path
git_tracking_branch = rwrepo.create_head('git_tracking#123')
rwrepo.git.branch('-u', special_name_remote_ref.name, git_tracking_branch.name)
- assert git_tracking_branch.tracking_branch().name == special_name_remote_ref.name
+ TBranch = gp_tracking_branch.tracking_branch()
+ if TBranch is not None:
+ assert TBranch.name == special_name_remote_ref.name
# END for each head
# verify REFLOG gets altered
@@ -453,7 +457,7 @@ class TestRefs(TestBase):
self.assertRaises(OSError, SymbolicReference.create, rw_repo, symref_path, cur_head.reference.commit)
# it works if the new ref points to the same reference
- SymbolicReference.create(rw_repo, symref.path, symref.reference).path == symref.path # @NoEffect
+ assert SymbolicReference.create(rw_repo, symref.path, symref.reference).path == symref.path # @NoEffect
SymbolicReference.delete(rw_repo, symref)
# would raise if the symref wouldn't have been deletedpbl
symref = SymbolicReference.create(rw_repo, symref_path, cur_head.reference)