diff --git a/.gitignore b/.gitignore index 9ab76a1..9570d53 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ .DS_Store *.pyc __pycache__ +.idea + diff --git a/passport/git.py b/passport/git.py index 9a1a4b3..cea2fc1 100644 --- a/passport/git.py +++ b/passport/git.py @@ -86,18 +86,24 @@ def config_set(config, value, property): Exception: If subprocess.Popen() fails """ try: - subprocess.Popen([ + git_process = subprocess.Popen([ "git", "config", "--local", "user." + property, value - ], stdout=subprocess.PIPE) + ], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL) + + # Captures the git return code + exit_status = git_process.wait() except Exception: raise - return True + if exit_status == 0: + return True + else: + return False def config_remove(verbose=True):