diff options
author | W. Trevor King <wking@drexel.edu> | 2009-08-04 15:42:49 -0400 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2009-08-04 15:42:49 -0400 |
commit | 75577588a978be2d7d8a8a71a00ea5b6ee53d944 (patch) | |
tree | 64caaedbb4484242c6b8bd55ad0378624c047e24 | |
parent | a109aa84c04079f438970df982bfa16a18bbf510 (diff) | |
download | bugseverywhere-75577588a978be2d7d8a8a71a00ea5b6ee53d944.tar.gz |
Now libbe.git.Git handles missing name/email and guesses instead.
-rw-r--r-- | .be/bugs/dcca51b3-bf8f-4482-8f67-662cfbcb9c6c/values | 2 | ||||
-rw-r--r-- | libbe/git.py | 16 |
2 files changed, 13 insertions, 5 deletions
diff --git a/.be/bugs/dcca51b3-bf8f-4482-8f67-662cfbcb9c6c/values b/.be/bugs/dcca51b3-bf8f-4482-8f67-662cfbcb9c6c/values index 6594420..375e44d 100644 --- a/.be/bugs/dcca51b3-bf8f-4482-8f67-662cfbcb9c6c/values +++ b/.be/bugs/dcca51b3-bf8f-4482-8f67-662cfbcb9c6c/values @@ -7,7 +7,7 @@ reporter: Gianluca Montecchi <gian@grys.it> severity: minor -status: open +status: fixed summary: BE should not crash if user.email and user.name are not defined diff --git a/libbe/git.py b/libbe/git.py index f7e9646..53bc030 100644 --- a/libbe/git.py +++ b/libbe/git.py @@ -53,10 +53,18 @@ class Git(RCS): def _rcs_init(self, path): self._u_invoke_client("init", directory=path) def _rcs_get_user_id(self): - status,output,error = self._u_invoke_client("config", "user.name") - name = output.rstrip('\n') - status,output,error = self._u_invoke_client("config", "user.email") - email = output.rstrip('\n') + status,output,error = \ + self._u_invoke_client("config", "user.name", expect=(0,1)) + if status == 0: + name = output.rstrip('\n') + else: + name = "" + status,output,error = \ + self._u_invoke_client("config", "user.email", expect=(0,1)) + if status == 0: + email = output.rstrip('\n') + else: + email = "" if name != "" or email != "": # got something! # guess missing info, if necessary if name == "": |