Skip to content

Fix condition check for current remote name in rename method #1342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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