Skip to content

Commit b787051

Browse files
authored
Merge pull request #779 from shijinglu/bumpNodeGit
Bump nodegit to ^0.25.0
2 parents 2721543 + 66f97e9 commit b787051

15 files changed

+80
-81
lines changed

Diff for: node/lib/util/git_util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ exports.isValidRemoteName = co.wrap(function *(repo, name) {
208208
assert.instanceOf(repo, NodeGit.Repository);
209209
assert.isString(name);
210210

211-
const remotes = yield repo.getRemotes();
211+
const remotes = yield repo.getRemoteNames();
212212
return remotes.find(x => x === name) !== undefined;
213213
});
214214

Diff for: node/lib/util/read_repo_ast_util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ exports.readRAST = co.wrap(function *(repo, includeRefsCommits) {
258258
includeRefsCommits = false;
259259
}
260260
assert.instanceOf(repo, NodeGit.Repository);
261-
const branches = yield repo.getReferences(NodeGit.Reference.TYPE.LISTALL);
261+
const branches = yield repo.getReferences();
262262
let commits = {};
263263
let branchTargets = {};
264264
let refTargets = {};

Diff for: node/lib/util/test_util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,12 @@ exports.makeBareCopy = co.wrap(function *(repo, path) {
257257
// Record the branches that exist in the bare repo.
258258

259259
let existingBranches = {};
260-
const bareRefs = yield bare.getReferences(NodeGit.Reference.TYPE.LISTALL);
260+
const bareRefs = yield bare.getReferences();
261261
bareRefs.forEach(r => existingBranches[r.shorthand()] = true);
262262

263263
// Then create all the branches that weren't copied initially.
264264

265-
const refs = yield repo.getReferences(NodeGit.Reference.TYPE.LISTALL);
265+
const refs = yield repo.getReferences();
266266
const sig = yield ConfigUtil.defaultSignature(bare);
267267
for (let i = 0; i < refs.length; ++i) {
268268
const ref = refs[i];

Diff for: node/lib/util/write_repo_ast_util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,7 @@ exports.writeMultiRAST = co.wrap(function *(repos, rootDirectory) {
754754

755755
repo.detachHead();
756756

757-
const refs = yield repo.getReferences(NodeGit.Reference.TYPE.LISTALL);
757+
const refs = yield repo.getReferences();
758758
for (let i = 0; i < refs.length; ++i) {
759759
NodeGit.Branch.delete(refs[i]);
760760
}

Diff for: node/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"preferGlobal": true,
2828
"homepage": "https://github.com/twosigma/git-meta#readme",
2929
"dependencies": {
30-
"argparse": "",
30+
"argparse": "^1.0.0",
3131
"binary-search": "",
3232
"chai": "",
3333
"child-process-promise": "",
@@ -36,7 +36,7 @@
3636
"deeper": "",
3737
"fs-promise": "",
3838
"group-by": "",
39-
"nodegit": "^0.23.0",
39+
"nodegit": "^0.25.0",
4040
"rimraf": "",
4141
"split": "",
4242
"walk": ""

Diff for: node/test/util/bulk_notes_util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ describe("readNotes", function () {
112112
const foo = yield repo.getBranchCommit("foo");
113113
const fooSha = foo.id().tostrS();
114114
const refName = "refs/notes/foo/bar";
115-
const sig = repo.defaultSignature();
115+
const sig = yield repo.defaultSignature();
116116
yield NodeGit.Note.create(repo, refName, sig, sig, fooSha, "foo", 1);
117117
yield NodeGit.Note.create(repo, refName, sig, sig, headSha, "bar", 1);
118118
const result = yield BulkNotesUtil.readNotes(repo, refName);

Diff for: node/test/util/config_util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,8 @@ describe("defaultSignature", function () {
9898
it("works", co.wrap(function *() {
9999
const repo = yield TestUtil.createSimpleRepository();
100100
const actual = yield ConfigUtil.defaultSignature(repo);
101-
assert.equal(actual.toString(),
102-
repo.defaultSignature().toString());
101+
const sig = yield repo.defaultSignature();
102+
assert.equal(actual.toString(), sig.toString());
103103
}));
104104
});
105105
});

Diff for: node/test/util/destitch_util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ describe("getDestitched", function () {
539539
metaCommit: "1",
540540
subCommits: {},
541541
};
542-
const sig = repo.defaultSignature();
542+
const sig = yield repo.defaultSignature();
543543
const refName = DestitchUtil.localReferenceNoteRef;
544544
const data = JSON.stringify(destitched, null, 4);
545545
yield NodeGit.Note.create(repo, refName, sig, sig, headSha, data, 1);
@@ -555,7 +555,7 @@ describe("getDestitched", function () {
555555
metaCommit: "1",
556556
subCommits: {},
557557
};
558-
const sig = repo.defaultSignature();
558+
const sig = yield repo.defaultSignature();
559559
const refName = StitchUtil.referenceNoteRef;
560560
const data = JSON.stringify(destitched, null, 4);
561561
yield NodeGit.Note.create(repo, refName, sig, sig, headSha, data, 1);

Diff for: node/test/util/git_util.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@ describe("GitUtil", function () {
11201120
const repo = yield TestUtil.createSimpleRepository();
11211121
const head = yield repo.getHeadCommit();
11221122
yield fs.appendFile(path.join(repo.workdir(), "README.md"), "foo");
1123-
const sig = repo.defaultSignature();
1123+
const sig = yield repo.defaultSignature();
11241124
const newCommitId = yield repo.createCommitOnHead(["README.md"],
11251125
sig,
11261126
sig,

Diff for: node/test/util/include.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ describe("include", function () {
115115
}));
116116

117117
it("should have signature of the current repo", co.wrap(function *() {
118-
const repoSignature = repo.defaultSignature();
118+
const repoSignature = yield repo.defaultSignature();
119119
const submoduleRepo =
120120
yield NodeGit.Repository.open(repo.workdir() + path);
121-
const submoduleSignature = submoduleRepo.defaultSignature();
121+
const submoduleSignature = yield submoduleRepo.defaultSignature();
122122

123123
assert.equal(repoSignature.toString(),
124124
submoduleSignature.toString());

Diff for: node/test/util/read_repo_ast_util.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ describe("readRAST", function () {
408408
it("headless with a commit", co.wrap(function *() {
409409
const path = yield TestUtil.makeTempDir();
410410
const r = yield NodeGit.Repository.init(path, 1);
411-
const sig = r.defaultSignature();
411+
const sig = yield r.defaultSignature();
412412
const builder = yield NodeGit.Treebuilder.create(r, null);
413413
const treeObj = yield builder.write();
414414
const tree = yield r.getTree(treeObj.tostrS());
@@ -467,7 +467,7 @@ describe("readRAST", function () {
467467
it("remote with path in tracking branch", co.wrap(function *() {
468468
const base = yield TestUtil.createSimpleRepository();
469469
const headId = (yield base.getHeadCommit()).id();
470-
const sig = base.defaultSignature();
470+
const sig = yield base.defaultSignature();
471471
yield base.createBranch("foo/bar", headId, 1, sig, "branch");
472472
const clonePath = yield TestUtil.makeTempDir();
473473
const clone = yield NodeGit.Clone.clone(base.workdir(), clonePath);
@@ -1007,7 +1007,7 @@ describe("readRAST", function () {
10071007
const workdir = repo.workdir();
10081008
const firstCommit = yield repo.getHeadCommit();
10091009
const firstSha = firstCommit.id().tostrS();
1010-
const sig = repo.defaultSignature();
1010+
const sig = yield repo.defaultSignature();
10111011
yield repo.createBranch("b", firstCommit, 0, sig);
10121012
yield repo.checkoutBranch("b");
10131013
yield fs.writeFile(path.join(workdir, "foo"), "foo");
@@ -1060,7 +1060,7 @@ describe("readRAST", function () {
10601060

10611061
it("merge commit with submodule change", co.wrap(function *() {
10621062
const repo = yield TestUtil.createSimpleRepository();
1063-
const sig = repo.defaultSignature();
1063+
const sig = yield repo.defaultSignature();
10641064

10651065
// Create the base repo for the submodule and add a couple of
10661066
// commits.
@@ -1217,7 +1217,7 @@ describe("readRAST", function () {
12171217

12181218
it("merge commit with ignored submodule change", co.wrap(function *() {
12191219
const repo = yield TestUtil.createSimpleRepository();
1220-
const sig = repo.defaultSignature();
1220+
const sig = yield repo.defaultSignature();
12211221

12221222
// Create the base repo for the submodule and add a couple of
12231223
// commits.
@@ -1372,7 +1372,7 @@ describe("readRAST", function () {
13721372
const head = yield r.getHeadCommit();
13731373
const headId = head.id();
13741374

1375-
const sig = r.defaultSignature();
1375+
const sig = yield r.defaultSignature();
13761376

13771377
yield NodeGit.Note.create(r, "refs/notes/test",
13781378
sig, sig, headId, "note", 0);
@@ -1688,7 +1688,7 @@ describe("readRAST", function () {
16881688
yield index.addByPath("foobar");
16891689
yield index.write();
16901690
yield NodeGit.Stash.save(repo,
1691-
repo.defaultSignature(),
1691+
yield repo.defaultSignature(),
16921692
"stash",
16931693
NodeGit.Stash.FLAGS.INCLUDE_UNTRACKED);
16941694
yield ReadRepoASTUtil.readRAST(repo);

Diff for: node/test/util/repo_ast_test_util.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const makeClone = co.wrap(function *(repos, maps) {
8585
// Test framework expects a trailing '/' to support relative paths.
8686

8787
const b = yield NodeGit.Clone.clone(aPath, bPath);
88-
const sig = b.defaultSignature();
88+
const sig = yield b.defaultSignature();
8989
const head = yield b.getHeadCommit();
9090
yield b.createBranch("foo", head.id(), 1, sig, "branch commit");
9191
yield b.checkoutBranch("foo");
@@ -265,7 +265,7 @@ Bmaster=1 origin/master`,
265265
m: co.wrap(function *(repos) {
266266
const x = repos.x;
267267
const head = yield x.getHeadCommit();
268-
const sig = x.defaultSignature();
268+
const sig = yield x.defaultSignature();
269269
yield repos.x.createBranch("foo", head, 0, sig);
270270
throw new UserError("bad bad");
271271
}),
@@ -293,7 +293,7 @@ Bmaster=1 origin/master`,
293293
const x = repos.x;
294294
const head = yield x.getHeadCommit();
295295
const headStr = head.id().tostrS();
296-
const sig = x.defaultSignature();
296+
const sig = yield x.defaultSignature();
297297
yield repos.x.createBranch(`foo-${headStr}`, head, 0, sig);
298298
}),
299299
e: "x=S",
@@ -316,7 +316,7 @@ Bmaster=1 origin/master`,
316316
const x = repos.x;
317317
const head = yield x.getHeadCommit();
318318
const headStr = head.id().tostrS();
319-
const sig = x.defaultSignature();
319+
const sig = yield x.defaultSignature();
320320
yield repos.x.createBranch(`foo-${headStr}`, head, 0, sig);
321321
}),
322322
e: "x=E:Bfoo-1=1",

Diff for: node/test/util/stash_util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ const RepoASTTestUtil = require("../../lib/util/repo_ast_test_util");
4242

4343
const writeLog = co.wrap(function *(repo, reverseMap, logs) {
4444
const log = yield NodeGit.Reflog.read(repo, "refs/meta-stash");
45-
const sig = repo.defaultSignature();
45+
const sig = yield repo.defaultSignature();
4646
for(let i = 0; i < logs.length; ++i) {
4747
const logSha = logs[logs.length - (i + 1)];
4848
const sha = reverseMap[logSha];
@@ -160,7 +160,7 @@ x=E:Ci#i foo=bar,1=1;Cw#w foo=bar,1=1;Bi=i;Bw=w`,
160160
const result = yield StashUtil.stashRepo(repo,
161161
status,
162162
includeUntracked);
163-
const sig = repo.defaultSignature();
163+
const sig = yield repo.defaultSignature();
164164
const commitMap = {};
165165
const commitAndBranch = co.wrap(function *(treeId, type) {
166166
const tree = yield NodeGit.Tree.lookup(repo, treeId);

Diff for: node/test/util/submodule_config_util.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ foo
652652
newHead,
653653
NodeGit.Reset.TYPE.HARD);
654654
yield submodule.addFinalize();
655-
const sig = repo.defaultSignature();
655+
const sig = yield repo.defaultSignature();
656656
yield repo.createCommitOnHead([".gitmodules", subName],
657657
sig,
658658
sig,
@@ -803,7 +803,7 @@ foo
803803
newHead,
804804
NodeGit.Reset.TYPE.HARD);
805805
yield submodule.addFinalize();
806-
const sig = repo.defaultSignature();
806+
const sig = yield repo.defaultSignature();
807807
yield repo.createCommitOnHead([".gitmodules", "foo"],
808808
sig,
809809
sig,

0 commit comments

Comments
 (0)