Skip to content

Commit d224940

Browse files
authored
Fix condition check for current remote name in rename method (#1342)
1 parent a011e26 commit d224940

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

pygit2/remotes.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ def rename(self, name, new_name):
376376
the standard format and thus could not be remapped.
377377
"""
378378

379-
if not new_name:
379+
if not name:
380380
raise ValueError('Current remote name must be a non-empty string')
381381

382382
if not new_name:

test/test_commit.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def test_read_commit(barerepo):
5858
assert 'c2792cfa289ae6321ecf2cd5806c2194b0fd070c' == parents[0].id
5959
assert commit.message_encoding is None
6060
assert commit.message == (
61-
'Second test data commit.\n\n' 'This commit has some additional text.\n'
61+
'Second test data commit.\n\nThis commit has some additional text.\n'
6262
)
6363
commit_time = 1288481576
6464
assert commit_time == commit.commit_time

test/test_merge.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,9 @@ def test_merge_mergeheads(mergerepo):
318318
assert mergerepo.listall_mergeheads() == [pygit2.Oid(hex=branch_head_hex)]
319319

320320
mergerepo.state_cleanup()
321-
assert (
322-
mergerepo.listall_mergeheads() == []
323-
), 'state_cleanup() should wipe the mergeheads'
321+
assert mergerepo.listall_mergeheads() == [], (
322+
'state_cleanup() should wipe the mergeheads'
323+
)
324324

325325

326326
def test_merge_message(mergerepo):

test/test_repository_bare.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def test_lookup_commit(barerepo):
135135
assert commit_sha == commit.id
136136
assert ObjectType.COMMIT == commit.type
137137
assert commit.message == (
138-
'Second test data commit.\n\n' 'This commit has some additional text.\n'
138+
'Second test data commit.\n\nThis commit has some additional text.\n'
139139
)
140140

141141

0 commit comments

Comments
 (0)