summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2021-03-19 17:11:41 +0100
committerSanto Cariotti <santo@dcariotti.me>2021-03-19 17:11:41 +0100
commitb9f8d1fc5183e942b28a55709bfcd1b22d691e79 (patch)
tree8deb30cb78598fcc68d2448198521e0473b02ad6
parent0fd8cc67f280143e815f1e2e449afa1f17c52a3b (diff)
fix: error on escape quote text
-rw-r--r--src/commit/models.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/commit/models.rs b/src/commit/models.rs
index deb2030..987bcd2 100644
--- a/src/commit/models.rs
+++ b/src/commit/models.rs
@@ -111,12 +111,12 @@ impl Commit {
"('{}', {}, E'{}', '{}', '{}', E'{}', '{}', E'{}', '{}'),",
commit.hash,
tree,
- commit.text.replace("'", "\\'"),
+ commit.text.replace("\\'", "'").replace("'", "\\'"),
commit.date,
commit.author_email,
- commit.author_name.replace("'", "\\'"),
+ commit.author_name.replace("\\'", "'").replace("'", "\\'"),
commit.committer_email,
- commit.committer_name.replace("'", "\\'"),
+ commit.committer_name.replace("\\'", "'").replace("'", "\\'"),
commit.repository_url
)[..]
}