| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7fbfc77 commit 5ca0fba
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -325,7 +325,7 @@ class FetchInfo(IterableObj): | |||
| 325 | 325 | ERROR, | |
| 326 | 326 | ) = [1 << x for x in range(8)] | |
| 327 | 327 | ||
| 328 | - _re_fetch_result = re.compile(r"^\s*(.) (\[[\w\s\.$@]+\]|[\w\.$@]+)\s+(.+) -> ([^\s]+)( \(.*\)?$)?") | ||
| 328 | + _re_fetch_result = re.compile(r"^ *(.) (\[[\w \.$@]+\]|[\w\.$@]+) +(.+) -> ([^ ]+)( \(.*\)?$)?") | ||
| 329 | 329 | ||
| 330 | 330 | _flag_map: Dict[flagKeyLiteral, int] = { | |
| 331 | 331 | "!": ERROR, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1002,6 +1002,21 @@ def test_push_unsafe_options_allowed(self, rw_repo): | |||
| 1002 | 1002 | assert tmp_file.exists() | |
| 1003 | 1003 | tmp_file.unlink() | |
| 1004 | 1004 | ||
| 1005 | + @with_rw_and_rw_remote_repo("0.1.6") | ||
| 1006 | + def test_fetch_unsafe_branch_name(self, rw_repo, remote_repo): | ||
| 1007 | + # Create branch with a name containing a NBSP | ||
| 1008 | + bad_branch_name = f"branch_with_{chr(160)}_nbsp" | ||
| 1009 | + Head.create(remote_repo, bad_branch_name) | ||
| 1010 | + | ||
| 1011 | + # Fetch and get branches | ||
| 1012 | + remote = rw_repo.remote("origin") | ||
| 1013 | + branches = remote.fetch() | ||
| 1014 | + | ||
| 1015 | + # Test for truncated branch name in branches | ||
| 1016 | + assert f"origin/{bad_branch_name}" in [b.name for b in branches] | ||
| 1017 | + | ||
| 1018 | + # Cleanup branch | ||
| 1019 | + Head.delete(remote_repo, bad_branch_name) | ||
| 1005 | 1020 | ||
| 1006 | 1021 | class TestTimeouts(TestBase): | |
| 1007 | 1022 | @with_rw_repo("HEAD", bare=False) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments