Skip to content

Commit 56849eb

Browse files
committed
remove one more manual enum
1 parent 002ed81 commit 56849eb

4 files changed

Lines changed: 10 additions & 16 deletions

File tree

lib/attr.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,4 @@ var NodeGit = require("../");
22

33
var Attr = NodeGit.Attr;
44

5-
Attr.Check = {
6-
FILE_THEN_INDEX: 0,
7-
INDEX_THEN_FILE: 1,
8-
INDEX_ONLY: 2,
9-
10-
NO_SYSTEM: 1 << 2
11-
};
12-
135
module.exports = Attr;

lib/status.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
var NodeGit = require("../");
2+
3+
var Status = NodeGit.Status;
4+
5+
module.exports = Status;

lib/tree.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,8 @@ Tree.prototype.entries = function() {
7373
var size = this.entryCount();
7474
var result = [];
7575

76-
var temp = [];
7776
for (var i = 0; i < size; i++) {
78-
var ent = this.entryByIndex(i)
79-
temp.push(i + " " + ent.filename() + " " + ent.attr());
80-
result.push(ent);
77+
result.push(this.entryByIndex(i));
8178
}
8279

8380
return result;
@@ -100,7 +97,6 @@ Tree.prototype.walk = function(blobsOnly) {
10097

10198
var self = this;
10299
var event = new events.EventEmitter();
103-
var entries = [];
104100

105101
var total = 1;
106102

test/tests/attr.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ describe("Attr", function() {
66

77
var Repository = require("../../lib/repository");
88
var Attr = require("../../lib/attr");
9+
var Status = require("../../lib/status");
910

1011
before(function() {
1112
var test = this;
@@ -25,8 +26,8 @@ describe("Attr", function() {
2526
Attr.cacheFlush(this.repository);
2627
});
2728

28-
it("can lookup the value of a git attribute", function() {
29-
var flags = Attr.Check.NO_SYSTEM;
30-
Attr.get(this.repository, flags, ".gitattributes", "test");
29+
it.only("can lookup the value of a git attribute", function() {
30+
var flags = Status.SHOW.INDEX_AND_WORKDIR;
31+
return Attr.get(this.repository, flags, ".gitattributes", "test");
3132
});
3233
});

0 commit comments

Comments
 (0)