mirror of
https://github.com/clockfort/GitHub-Backup.git
synced 2025-03-23 00:00:05 +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.)
|
# Fetch description and owner (useful for gitweb, cgit etc.)
|
||||||
# TODO: can we combine that in a single call to 'git config'
|
# 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:
|
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 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):
|
def shell_escape(str):
|
||||||
if str:
|
if str:
|
||||||
return "'" + unicode(str.replace("'", "\\'")).encode("utf-8") + "'"
|
return "'" + unicode(str.replace("'", "'\\''")).encode("utf-8") + "'"
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
main()
|
main()
|
||||||
|
|
Loading…
Add table
Reference in a new issue