mirror of
https://github.com/clockfort/GitHub-Backup.git
synced 2025-03-16 00:00:06 +01:00
Fixed shell_escaping on single-quote; skipping gitweb.description assignment when description is None
This commit is contained in:
parent
96553fa6e9
commit
602293722a
1 changed files with 3 additions and 2 deletions
|
@ -105,7 +105,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),))
|
||||
if repo.description is not None:
|
||||
os.system("git config --local gitweb.description %s"%(shell_escape(repo.description),))
|
||||
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"))),))
|
||||
|
||||
|
@ -117,7 +118,7 @@ def update_repo(repo, dir, args):
|
|||
|
||||
def shell_escape(str):
|
||||
if str:
|
||||
return "'" + unicode(str.replace("'", "\\'")).encode("utf-8") + "'"
|
||||
return "'" + unicode(str.replace("'", "'\\''")).encode("utf-8") + "'"
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
|
Loading…
Add table
Reference in a new issue