From 3c00e6a64b8f9a4db667d96af3aef7600fbc6bb4 Mon Sep 17 00:00:00 2001 From: Enrico Date: Wed, 20 Jul 2016 23:15:35 +0200 Subject: [PATCH] Fixed crash when no e-mail is available from GitHub repos API --- github-backup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/github-backup.py b/github-backup.py index 50d1a18..a92b49f 100755 --- a/github-backup.py +++ b/github-backup.py @@ -106,7 +106,8 @@ def update_repo(repo, dir, args): # Fetch description and owner (useful for gitweb, cgit etc.) # TODO: can we combine that in a single call to 'git config' os.system("git config --local gitweb.description %s"%(shell_escape(repo.description),)) - os.system("git config --local gitweb.owner %s"%(shell_escape("%s <%s>"%(repo.user.name, repo.user.email.encode("utf-8"))),)) + if repo.user.name is not None and repo.user.email is not None: + os.system("git config --local gitweb.owner %s"%(shell_escape("%s <%s>"%(repo.user.name, repo.user.email.encode("utf-8"))),)) os.system("git config --local cgit.name %s"%(shell_escape(repo.name),)) os.system("git config --local cgit.defbranch %s"%(shell_escape(repo.default_branch),))