Skip to content
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 git/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ class FetchInfo(IterableObj):
ERROR,
) = [1 << x for x in range(8)]

_re_fetch_result = re.compile(r"^ *(?:.{0,3})(.) (\[[\w \.$@]+\]|[\w\.$@]+) +(.+) -> ([^ ]+)( \(.*\)?$)?")
_re_fetch_result = re.compile(r"^ *(?:.{0,3})(.) (\[[\w \.$@]+\]|[\w\.$@]+) +(.+) -> ([^ ]+)( \(.*\)?$)?")

_flag_map: Dict[flagKeyLiteral, int] = {
"!": ERROR,
Expand Down
10 changes: 9 additions & 1 deletion test/test_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def get_info(res, remote, name):
mkey = "%s/%s" % (remote, "master")
master_info = res[mkey]
self.assertTrue(master_info.flags & FetchInfo.FORCED_UPDATE)
self.assertIsNotNone(master_info.note)
self.assertEqual(master_info.note, "(forced update)")

# Normal fast forward - set head back to previous one.
rhead.commit = remote_commit
Expand Down Expand Up @@ -573,6 +573,14 @@ def test_fetch_info(self):
self.assertIsInstance(info.ref, ref_type)
self.assertEqual(info.remote_ref_path, source)
self.assertTrue(info.flags & FetchInfo.NEW_HEAD)
self.assertEqual(info.note, "")
info = FetchInfo._from_line(
self.rorepo,
"! [rejected] tag -> subdir/tag (would clobber existing tag)",
["refs/tags/tag:refs/tags/subdir/tag"],
)
self.assertTrue(info.flags & FetchInfo.REJECTED)
self.assertEqual(info.note, "(would clobber existing tag)")
with self.assertRaises(ValueError):
FetchInfo._from_line(self.rorepo, "= [up to date] master -> ambiguous")

Expand Down
Loading