client/credentials: remove end of line markers from the git credentials file

A spurious \n wont do much good from call sites,
where it is not present and we do not want
to append such a thing.
2 files changed, 2 insertions(+), 2 deletions(-)

M dulwich/client.py
M dulwich/tests/test_client.py
M dulwich/client.py +1 -1
@@ 1924,7 1924,7 @@ def get_credentials_from_store(scheme, h
         try:
             with open(fname, 'rb') as f:
                 for line in f:
-                    parsed_line = urlparse(line)
+                    parsed_line = urlparse(line.strip())
                     if (parsed_line.scheme == scheme and
                             parsed_line.hostname == hostname and
                             (username is None or

          
M dulwich/tests/test_client.py +1 -1
@@ 1336,7 1336,7 @@ class GitCredentialStoreTests(TestCase):
     @classmethod
     def setUpClass(cls):
         with tempfile.NamedTemporaryFile(delete=False) as f:
-            f.write(b'https://user:pass@example.org')
+            f.write(b'https://user:pass@example.org\n')
         cls.fname = f.name
 
     @classmethod