Skip to content

Commit 665a102

Browse files
committed
update add-and-commit for sync signature.create
1 parent f0e254f commit 665a102

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

example/add-and-commit.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,9 @@ git.Repository.open(path.resolve(__dirname, '../.git'))
4444
.then(function(head) {
4545
return repo.getCommit(head);
4646
})
47-
.then(function(parentResult) {
48-
return Promise.all([
49-
git.Signature.create("Scott Chacon", "schacon@gmail.com", 123456789, 60),
50-
git.Signature.create("Scott A Chacon", "scott@github.com", 987654321, 90)
51-
])
52-
})
53-
.then(function(signatures){
54-
var author = signatures[0];
55-
var committer = signatures[1];
47+
.then(function(parent) {
48+
var author = git.Signature.create("Scott Chacon", "schacon@gmail.com", 123456789, 60);
49+
var committer = git.Signature.create("Scott A Chacon", "scott@github.com", 987654321, 90);
5650

5751
return repo.createCommit('HEAD', author, committer, 'message', oid, [parent]);
5852
})

newfile.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
hello world

0 commit comments

Comments
 (0)