Escapes special characters in description

This commit is contained in:
Amlesh Sivanantham (zamlz) 2019-03-21 17:52:12 -07:00
parent 1f1bbea917
commit 3ee2c1eaec
No known key found for this signature in database
GPG Key ID: 882C395C3B28902C

View File

@ -34,4 +34,6 @@ def git_commit_event(PaperEventInstance):
if isinstance(PaperEventInstance, RenameEvent): if isinstance(PaperEventInstance, RenameEvent):
git.shell("add \*/{}.\*".format(PaperEventInstance.old_citekey)) git.shell("add \*/{}.\*".format(PaperEventInstance.old_citekey))
git.shell("add \*/{}.\*".format(PaperEventInstance.citekey)) git.shell("add \*/{}.\*".format(PaperEventInstance.citekey))
git.shell('commit -m "{}"'.format(PaperEventInstance.description)) cmesg = PaperEventInstance.description
cmesg = cmesg.replace('\\','\\\\').replace('"','\\"').replace('$','\\$').replace('`','\\`')
git.shell('commit -m "{}"'.format(cmesg))