Skip to content

Commit

Permalink
Fix condition check for current remote name in rename method (#1342)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktpa authored Jan 17, 2025
1 parent a011e26 commit d224940
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pygit2/remotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ def rename(self, name, new_name):
the standard format and thus could not be remapped.
"""

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

if not new_name:
Expand Down
2 changes: 1 addition & 1 deletion test/test_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def test_read_commit(barerepo):
assert 'c2792cfa289ae6321ecf2cd5806c2194b0fd070c' == parents[0].id
assert commit.message_encoding is None
assert commit.message == (
'Second test data commit.\n\n' 'This commit has some additional text.\n'
'Second test data commit.\n\nThis commit has some additional text.\n'
)
commit_time = 1288481576
assert commit_time == commit.commit_time
Expand Down
6 changes: 3 additions & 3 deletions test/test_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,9 +318,9 @@ def test_merge_mergeheads(mergerepo):
assert mergerepo.listall_mergeheads() == [pygit2.Oid(hex=branch_head_hex)]

mergerepo.state_cleanup()
assert (
mergerepo.listall_mergeheads() == []
), 'state_cleanup() should wipe the mergeheads'
assert mergerepo.listall_mergeheads() == [], (
'state_cleanup() should wipe the mergeheads'
)


def test_merge_message(mergerepo):
Expand Down
2 changes: 1 addition & 1 deletion test/test_repository_bare.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def test_lookup_commit(barerepo):
assert commit_sha == commit.id
assert ObjectType.COMMIT == commit.type
assert commit.message == (
'Second test data commit.\n\n' 'This commit has some additional text.\n'
'Second test data commit.\n\nThis commit has some additional text.\n'
)


Expand Down

0 comments on commit d224940

Please sign in to comment.