Comparing version 3.2.1 to 3.2.2
@@ -17,8 +17,11 @@ /** | ||
// JSON string | ||
var h = log.match(/".*?": "(.*?)"[,}]/g); | ||
var jsonValueRegex = /".*?":"(.*?)"[,}]/g; | ||
var h = log.match(jsonValueRegex); | ||
if (h) { | ||
for (var i = h.length - 1; i >= 0; i--) { | ||
var hh = h[i].replace(/".*?": "(.*?)"[,}]/g, '$1'); | ||
var hhh = hh.replace(/\"/g, '\\"'); | ||
var hh = h[i].replace(jsonValueRegex, '$1'); | ||
var hhh = hh.replace(/\"/g, '\\"').replace(/\'/g, ""); | ||
@@ -25,0 +28,0 @@ log = log.replace(hh, hhh); |
{ | ||
"name": "gitty", | ||
"version": "3.2.1", | ||
"version": "3.2.2", | ||
"description": "A Node.js wrapper for the Git CLI", | ||
@@ -5,0 +5,0 @@ "main": "index", |
@@ -166,2 +166,21 @@ var fs = require('fs'); | ||
it('should be able to parse commit messages with quotation marks', function(done) { | ||
//add a file so something can be committed | ||
fs.writeFileSync(repo1.path + '/testFile.txt', 'i am a file'); | ||
repo1.addSync(['testFile.txt']); | ||
var commitMessage = "this commit shouldn't fail due to apostrophe, or \"quotation marks"; | ||
repo1.commitSync(commitMessage.replace(/\"/g, '\\"').replace(/\'/g, "\\'")); | ||
repo1.log(function(err, log) { | ||
should.not.exist(err); | ||
log.should.have.lengthOf(2); | ||
repo1.resetSync(log[1].commit); //reset the commit | ||
done(); | ||
}); | ||
}); | ||
}); | ||
@@ -168,0 +187,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
62995
1716