From 3ee2c1eaeca2f720b82272176274ad0d48787b00 Mon Sep 17 00:00:00 2001 From: "Amlesh Sivanantham (zamlz)" Date: Thu, 21 Mar 2019 17:52:12 -0700 Subject: [PATCH] Escapes special characters in description --- pubs/plugs/git/git.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pubs/plugs/git/git.py b/pubs/plugs/git/git.py index 64642c7..b262aaa 100644 --- a/pubs/plugs/git/git.py +++ b/pubs/plugs/git/git.py @@ -34,4 +34,6 @@ def git_commit_event(PaperEventInstance): if isinstance(PaperEventInstance, RenameEvent): git.shell("add \*/{}.\*".format(PaperEventInstance.old_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))