Commit 6f5c033c authored by Carson Howard's avatar Carson Howard

Fixed linter errors

parent 12919bf6
...@@ -736,7 +736,13 @@ Repository.prototype.discardLines = ...@@ -736,7 +736,13 @@ Repository.prototype.discardLines =
return repo.refreshIndex() return repo.refreshIndex()
.then(function(indexResult) { .then(function(indexResult) {
index = indexResult; index = indexResult;
return FilterList.load(repo, null, filePath, Filter.MODE.CLEAN, Filter.FLAG.DEFAULT); return FilterList.load(
repo,
null,
filePath,
Filter.MODE.CLEAN,
Filter.FLAG.DEFAULT
);
}) })
.then(function(_filterList) { .then(function(_filterList) {
filterList = _filterList; filterList = _filterList;
...@@ -762,11 +768,21 @@ Repository.prototype.discardLines = ...@@ -762,11 +768,21 @@ Repository.prototype.discardLines =
); );
}) })
.then(function(newContent) { .then(function(newContent) {
return FilterList.load(repo, null, filePath, Filter.MODE.SMUDGE, Filter.FLAG.DEFAULT) return FilterList.load(
repo,
null,
filePath,
Filter.MODE.SMUDGE,
Filter.FLAG.DEFAULT
)
.then(function(_filterList) { .then(function(_filterList) {
filterList = _filterList; filterList = _filterList;
if (filterList) { if (filterList) {
/* jshint ignore:start */
// We need the constructor for the check in NodeGit's C++ layer
// to accept an object, and this seems to be a nice way to do it
return filterList.applyToData(new String(newContent)); return filterList.applyToData(new String(newContent));
/* jshint ignore:end */
} }
return newContent; return newContent;
......
...@@ -976,7 +976,13 @@ describe("Filter", function() { ...@@ -976,7 +976,13 @@ describe("Filter", function() {
assert.notStrictEqual(readmeContent, message); assert.notStrictEqual(readmeContent, message);
fse.writeFileSync(readmePath, "whoa", "utf8"); fse.writeFileSync(readmePath, "whoa", "utf8");
return FilterList.load(test.repository, null, "README.md", NodeGit.Filter.MODE.CLEAN, NodeGit.Filter.FLAG.DEFAULT); return FilterList.load(
test.repository,
null,
"README.md",
NodeGit.Filter.MODE.CLEAN,
NodeGit.Filter.FLAG.DEFAULT
);
}) })
.then(function(_list) { .then(function(_list) {
list = _list; list = _list;
...@@ -1014,11 +1020,19 @@ describe("Filter", function() { ...@@ -1014,11 +1020,19 @@ describe("Filter", function() {
assert.notStrictEqual(readmeContent, message); assert.notStrictEqual(readmeContent, message);
fse.writeFileSync(readmePath, "whoa", "utf8"); fse.writeFileSync(readmePath, "whoa", "utf8");
return FilterList.load(test.repository, null, "README.md", NodeGit.Filter.MODE.CLEAN, NodeGit.Filter.FLAG.DEFAULT); return FilterList.load(
test.repository,
null,
"README.md",
NodeGit.Filter.MODE.CLEAN,
NodeGit.Filter.FLAG.DEFAULT
);
}) })
.then(function(_list) { .then(function(_list) {
list = _list; list = _list;
/* jshint ignore:start */
return list.applyToData(new String("garbo garbo garbo garbo")); return list.applyToData(new String("garbo garbo garbo garbo"));
/* jshint ignore:end */
}) })
.then(function(content) { .then(function(content) {
assert.strictEqual(content, message); assert.strictEqual(content, message);
...@@ -1052,7 +1066,13 @@ describe("Filter", function() { ...@@ -1052,7 +1066,13 @@ describe("Filter", function() {
assert.notStrictEqual(readmeContent, message); assert.notStrictEqual(readmeContent, message);
fse.writeFileSync(readmePath, "whoa", "utf8"); fse.writeFileSync(readmePath, "whoa", "utf8");
return FilterList.load(test.repository, null, "README.md", NodeGit.Filter.MODE.CLEAN, NodeGit.Filter.FLAG.DEFAULT); return FilterList.load(
test.repository,
null,
"README.md",
NodeGit.Filter.MODE.CLEAN,
NodeGit.Filter.FLAG.DEFAULT
);
}) })
.then(function(_list) { .then(function(_list) {
list = _list; list = _list;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment