Skip to content

Commit 8c8dc4c

Browse files
committed
Update jsdoc and ignore some methods
1 parent 92f328a commit 8c8dc4c

File tree

14 files changed

+122
-49
lines changed

14 files changed

+122
-49
lines changed

generate/input/descriptor.json

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@
7171
},
7272
"types":
7373
{
74+
"annotated": {
75+
"functions": {
76+
"git_annotated_commit_free": {
77+
"ignore": true
78+
}
79+
}
80+
},
7481
"attr": {
7582
"functions": {
7683
"git_attr_foreach": {
@@ -83,6 +90,14 @@
8390
"isReturn": true
8491
}
8592
}
93+
},
94+
"git_attr_get_many": {
95+
"args": {
96+
"values_out": {
97+
"isReturn": true,
98+
"jsClassName": "Array"
99+
}
100+
}
86101
}
87102
}
88103
},
@@ -126,6 +141,9 @@
126141
},
127142
"branch": {
128143
"functions": {
144+
"git_branch_iterator_free": {
145+
"ignore": true
146+
},
129147
"git_branch_create": {
130148
"args": {
131149
"force": {
@@ -853,6 +871,9 @@
853871
},
854872
"note": {
855873
"functions": {
874+
"git_note_iterator_free": {
875+
"ignore": true
876+
},
856877
"git_note_create": {
857878
"args": {
858879
"out": {
@@ -1096,6 +1117,9 @@
10961117
},
10971118
"pathspec": {
10981119
"functions": {
1120+
"git_pathspec_match_list_free": {
1121+
"ignore": true
1122+
},
10991123
"git_pathspec_new": {
11001124
"ignore": true
11011125
}
@@ -1344,6 +1368,9 @@
13441368
},
13451369
"repository": {
13461370
"functions": {
1371+
"git_repository_init_init_options": {
1372+
"ignore": true
1373+
},
13471374
"git_repository_discover": {
13481375
"ignore": true
13491376
},
@@ -1364,6 +1391,13 @@
13641391
}
13651392
}
13661393
},
1394+
"revert": {
1395+
"functions": {
1396+
"git_revert_init_options": {
1397+
"ignore": true
1398+
}
1399+
}
1400+
},
13671401
"revparse": {
13681402
"functions": {
13691403
"git_revparse": {
@@ -1542,6 +1576,9 @@
15421576
},
15431577
"tree": {
15441578
"functions": {
1579+
"git_tree_entry_free": {
1580+
"ignore": true
1581+
},
15451582
"git_tree_entry_byindex": {
15461583
"jsFunctionName": "_entryByIndex"
15471584
},

lib/blob.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ var Blob = NodeGit.Blob;
66

77
/**
88
* Retrieves the blob pointed to by the oid
9+
* @async
910
* @param {Repository} repo The repo that the blob lives in
1011
* @param {String|Oid|Blob} id The blob to lookup
11-
* @param {Function} callback
1212
* @return {Blob}
1313
*/
1414
Blob.lookup = LookupWrapper(Blob);
1515

1616
/**
1717
* Retrieve the content of the Blob.
1818
*
19-
* @return {Buffer} Contents.
19+
* @return {Buffer} Contents as a buffer.
2020
*/
2121
Blob.prototype.content = function() {
2222
return this.rawcontent().toBuffer(this.rawsize());
@@ -25,7 +25,7 @@ Blob.prototype.content = function() {
2525
/**
2626
* Retrieve the Blob's content as String.
2727
*
28-
* @return {string} Contents.
28+
* @return {String} Contents as a string.
2929
*/
3030
Blob.prototype.toString = function() {
3131
return this.content().toString();
@@ -34,7 +34,7 @@ Blob.prototype.toString = function() {
3434
/**
3535
* Retrieve the Blob's type.
3636
*
37-
* @return {number} The filemode.
37+
* @return {Number} The filemode of the blob.
3838
*/
3939
Blob.prototype.filemode = function() {
4040
var FileMode = TreeEntry.FILEMODE;

lib/checkout.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@ var tree = Checkout.tree;
88
/**
99
* Patch head checkout to automatically coerce objects.
1010
*
11-
* @param url
12-
* @param options
11+
* @async
12+
* @param {Repository} repo The repo to checkout head
13+
* @param {CheckoutOptions} [options] Options for the checkout
14+
* @return {Void} checkout complete
1315
*/
1416
Checkout.head = function(url, options) {
1517
options = normalizeOptions(options, NodeGit.CheckoutOptions);
@@ -20,9 +22,11 @@ Checkout.head = function(url, options) {
2022
/**
2123
* Patch tree checkout to automatically coerce objects.
2224
*
23-
* @param repo
24-
* @param treeish
25-
* @param options
25+
* @async
26+
* @param {Repository} repo
27+
* @param {Oid|Tree|Commit|Reference} treeish
28+
* @param {CheckoutOptions} [options]
29+
* @return {Void} checkout complete
2630
*/
2731
Checkout.tree = function(repo, treeish, options) {
2832
options = normalizeOptions(options, NodeGit.CheckoutOptions);

lib/clone.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ var clone = Clone.clone;
77
/**
88
* Patch repository cloning to automatically coerce objects.
99
*
10-
* @param url
11-
* @param local_path
12-
* @param options
10+
* @async
11+
* @param {String} url url of the repository
12+
* @param {String} local_path local path to store repository
13+
* @param {CloneOptions} [options]
14+
* @return {Repository} repo
1315
*/
1416
Clone.clone = function(url, local_path, options) {
1517
var remoteCallbacks;

lib/commit.js

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ var Commit = NodeGit.Commit;
77

88
/**
99
* Retrieves the commit pointed to by the oid
10+
* @async
1011
* @param {Repository} repo The repo that the commit lives in
1112
* @param {String|Oid|Commit} id The commit to lookup
12-
* @param {Function} callback
1313
* @return {Commit}
1414
*/
1515
Commit.lookup = LookupWrapper(Commit);
@@ -41,7 +41,7 @@ Commit.prototype.date = function() {
4141
/**
4242
* Get the tree associated with this commit.
4343
*
44-
* @param {Function} callback
44+
* @async
4545
* @return {Tree}
4646
*/
4747
Commit.prototype.getTree = function(callback) {
@@ -52,8 +52,8 @@ Commit.prototype.getTree = function(callback) {
5252
* Retrieve the entry represented by path for this commit.
5353
* Path must be relative to repository root.
5454
*
55+
* @async
5556
* @param {String} path
56-
* @param {Function} callback
5757
* @return {TreeEntry}
5858
*/
5959
Commit.prototype.getEntry = function(path, callback) {
@@ -68,16 +68,20 @@ Commit.prototype.getEntry = function(path, callback) {
6868
}, callback);
6969
};
7070

71+
7172
/**
7273
* Walk the history from this commit backwards.
74+
*
7375
* An EventEmitter is returned that will emit a "commit" event for each
7476
* commit in the history, and one "end" event when the walk is completed.
75-
* Don"t forget to call `start()` on the returned event.
77+
* Don't forget to call `start()` on the returned event.
7678
*
77-
* @fires Commit#commit
78-
* @fires Commit#end
79+
* @fires EventEmitter#commit Commit
80+
* @fires EventEmitter#end Array<Commit>
81+
* @fires EventEmitter#error Error
7982
*
8083
* @return {EventEmitter}
84+
* @start start()
8185
*/
8286
Commit.prototype.history = function() {
8387
var event = new events.EventEmitter();
@@ -107,12 +111,14 @@ Commit.prototype.history = function() {
107111
return event;
108112
};
109113

114+
110115
/**
111-
* Retrieve the commit"s parents -- as commit objects.
116+
* Retrieve the commit's parents as commit objects.
112117
*
113-
* @param {number} limit - Optional amount of parents to return.
118+
* @async
119+
* @param {number} limit Optional amount of parents to return.
114120
* @param {Function} callback
115-
* @return {[Commit]} array of commits
121+
* @return {Array<Commit>} array of commits
116122
*/
117123
Commit.prototype.getParents = function(limit, callback) {
118124
var parents = [];
@@ -147,7 +153,7 @@ Commit.prototype.getParents = function(limit, callback) {
147153
* Retrieve the commit"s parent shas.
148154
*
149155
* @param {Function} callback
150-
* @return {[Oid]} array of oids
156+
* @return {Array<Oids>} array of oids
151157
*/
152158
Commit.prototype.parents = function() {
153159
var result = [];
@@ -163,8 +169,9 @@ Commit.prototype.parents = function() {
163169
* Generate an array of diff trees showing changes between this commit
164170
* and its parent(s).
165171
*
172+
* @async
166173
* @param {Function} callback
167-
* @return {[Diff]} an array of diffs
174+
* @return {Array<Diff>} an array of diffs
168175
*/
169176
Commit.prototype.getDiff = function(callback) {
170177
var commit = this;

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var Index = NodeGit.Index;
44

55
/**
66
* Return an array of the entries in this index.
7-
* @return {[IndexEntry]} an array of IndexEntrys
7+
* @return {Array<IndexEntry>} an array of IndexEntrys
88
*/
99
Index.prototype.entries = function() {
1010
var size = this.entryCount();

lib/merge.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ var mergeCommits = Merge.commits;
99
* Merge 2 commits together and create an new index that can
1010
* be used to create a merge commit.
1111
*
12-
* @param repo Repository that contains the given commits
13-
* @param ourCommit The commit that reflects the destination tree
14-
* @oaram theirCommit The commit to merge into ourCommit
15-
* @param options The merge tree options (null for default)
12+
* @param {Repository} repo Repository that contains the given commits
13+
* @param {Commit} ourCommit The commit that reflects the destination tree
14+
* @param {Commit} theirCommit The commit to merge into ourCommit
15+
* @param {MergeOptions} [options] The merge tree options (null for default)
1616
*/
1717
Merge.commits = function(repo, ourCommit, theirCommit, options) {
1818
options = normalizeOptions(options, NodeGit.MergeOptions);

lib/reference.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var Branch = NodeGit.Branch;
66

77
/**
88
* Retrieves the reference pointed to by the oid
9+
* @async
910
* @param {Repository} repo The repo that the reference lives in
1011
* @param {String|Reference} id The reference to lookup
1112
* @param {Function} callback
@@ -15,6 +16,7 @@ Reference.lookup = LookupWrapper(Reference);
1516

1617
/**
1718
* Retrieves the reference by it's short name
19+
* @async
1820
* @param {Repository} repo The repo that the reference lives in
1921
* @param {String|Reference} id The reference to lookup
2022
* @param {Function} callback

lib/remote.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ var setCallbacks = Remote.prototype.setCallbacks;
77

88
/**
99
* Retrieves the remote by name
10+
* @async
1011
* @param {Repository} repo The repo that the remote lives in
1112
* @param {String|Remote} name The remote to lookup
1213
* @param {Function} callback

0 commit comments

Comments
 (0)