@@ -176,9 +176,9 @@ def get(self, credential: "Credential", **kwargs) -> "Credential":
176
176
logger .debug (res .stderr )
177
177
178
178
credentials = {}
179
- for line in res .stdout .strip (). splitlines ():
179
+ for line in res .stdout .splitlines ():
180
180
try :
181
- key , value = line .split ("=" )
181
+ key , value = line .split ("=" , maxsplit = 1 )
182
182
credentials [key ] = value
183
183
except ValueError :
184
184
continue
@@ -399,7 +399,8 @@ def _get_interactive(
399
399
400
400
def store (self , credential : "Credential" , ** kwargs ):
401
401
"""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
403
404
404
405
def erase (self , credential : "Credential" , ** kwargs ):
405
406
"""Remove a matching credential, if any, from the helper’s storage"""
@@ -514,7 +515,7 @@ def __init__(
514
515
self .username = self .username or parsed .username
515
516
self .password = self .password or parsed .password
516
517
if parsed .path :
517
- self .path = self .path or parsed .path
518
+ self .path = self .path or parsed .path . lstrip ( "/" )
518
519
519
520
def __getitem__ (self , key : object ) -> str :
520
521
if isinstance (key , str ):
0 commit comments