@@ -176,9 +176,9 @@ def get(self, credential: "Credential", **kwargs) -> "Credential":
176176 logger .debug (res .stderr )
177177
178178 credentials = {}
179- for line in res .stdout .strip (). splitlines ():
179+ for line in res .stdout .splitlines ():
180180 try :
181- key , value = line .split ("=" )
181+ key , value = line .split ("=" , maxsplit = 1 )
182182 credentials [key ] = value
183183 except ValueError :
184184 continue
@@ -399,7 +399,8 @@ def _get_interactive(
399399
400400 def store (self , credential : "Credential" , ** kwargs ):
401401 """Store the credential, if applicable to the helper"""
402- self [credential ] = credential
402+ if credential .protocol or credential .host or credential .path :
403+ self [credential ] = credential
403404
404405 def erase (self , credential : "Credential" , ** kwargs ):
405406 """Remove a matching credential, if any, from the helper’s storage"""
@@ -514,7 +515,7 @@ def __init__(
514515 self .username = self .username or parsed .username
515516 self .password = self .password or parsed .password
516517 if parsed .path :
517- self .path = self .path or parsed .path
518+ self .path = self .path or parsed .path . lstrip ( "/" )
518519
519520 def __getitem__ (self , key : object ) -> str :
520521 if isinstance (key , str ):
0 commit comments