Skip to content

Commit 92f328a

Browse files
author
John Haley
committed
Add a few comments to add-and-commit.js to clarify intent
This fixes #409
1 parent 2baa156 commit 92f328a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

examples/add-and-commit.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,15 @@ nodegit.Repository.open(path.resolve(__dirname, "../.git"))
4242
return index.read(1);
4343
})
4444
.then(function() {
45+
// this file is in the root of the directory and doesn't need a full path
4546
return index.addByPath(fileName);
4647
})
4748
.then(function() {
49+
// this file is in a subdirectory and can use a relative path
4850
return index.addByPath(path.join(directoryName, fileName));
4951
})
5052
.then(function() {
53+
// this will write both files to the index
5154
return index.write();
5255
})
5356
.then(function() {

0 commit comments

Comments
 (0)