diff --git a/TNTGitHook/utils.py b/TNTGitHook/utils.py index a6c1299..db3752c 100644 --- a/TNTGitHook/utils.py +++ b/TNTGitHook/utils.py @@ -45,7 +45,7 @@ def first(function: Callable[[T], bool], iterable: Iterable[T]) -> T: def formatRemoteURL(remoteURL) -> str: userPattern = "\/+\w.*\:" - tokenPattern = "\:+([\w\d]*)@" + tokenPattern = "\:+([\w\d-]*)@" if(remoteURL is None): return remoteURL diff --git a/utils_test.py b/utils_test.py index 3adbe80..7da90ff 100644 --- a/utils_test.py +++ b/utils_test.py @@ -32,7 +32,7 @@ def test_parse_full_activities_data(self): self.assertIsNotNone(activity.projectRole) def test_replace_user_and_token_when_remote_url_contains_them(self): - remoteURL = "https://nassr.mousati:ghp_LuToBb2F@github.com/user/dummy.git" + remoteURL = "https://nassr.mousati:ghp_LuToBb2F-@github.com/user/dummy.git" expectedRemoteURL = "https://****:****@github.com/user/dummy.git" formatedRemoteURL = formatRemoteURL(remoteURL) self.assertEqual(formatedRemoteURL, expectedRemoteURL)