Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfdb1dc7

Browse files
uri-canvaByron
authored andcommitted
Parse rejected deletes.
1 parent359a7e0 commitfdb1dc7

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

‎git/remote.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,10 @@ def _from_line(cls, remote, line):
156156
ifflags&cls.DELETED:
157157
from_ref=None
158158
else:
159-
from_ref=Reference.from_path(remote.repo,from_ref_string)
159+
iffrom_ref_string=="(delete)":
160+
from_ref=None
161+
else:
162+
from_ref=Reference.from_path(remote.repo,from_ref_string)
160163

161164
# commit handling, could be message or commit info
162165
old_commit=None

‎git/test/test_remote.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,14 @@ def _assert_push_and_pull(self, remote, rw_repo, remote_repo):
385385
progress.make_assertion()
386386
self._do_test_push_result(res,remote)
387387

388+
# rejected stale delete
389+
force_with_lease="%s:0000000000000000000000000000000000000000"%new_head.path
390+
res=remote.push(":%s"%new_head.path,force_with_lease=force_with_lease)
391+
self.assertTrue(res[0].flags&PushInfo.ERROR)
392+
self.assertTrue(res[0].flags&PushInfo.REJECTED)
393+
self.assertIsNone(res[0].local_ref)
394+
self._do_test_push_result(res,remote)
395+
388396
# delete new branch on the remote end and locally
389397
res=remote.push(":%s"%new_head.path)
390398
self._do_test_push_result(res,remote)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp