Skip to content

Commit bf2acf9

Browse files
committed
fix test
1 parent 9c1f745 commit bf2acf9

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

lib/repository.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -537,19 +537,19 @@ Repository.prototype.mergeBranches = function(to, from) {
537537
var toBranch;
538538

539539
return Promise.all([
540-
repo.getBranch(from),
541-
repo.getBranch(to)
540+
repo.getBranch(to),
541+
repo.getBranch(from)
542542
]).then(function(branches) {
543-
fromBranch = branches[0];
544-
toBranch = branches[1];
543+
toBranch = branches[0];
544+
fromBranch = branches[1];
545545

546546
return Promise.all([
547-
repo.getBranchCommit(fromBranch),
548-
repo.getBranchCommit(toBranch)
547+
repo.getBranchCommit(toBranch),
548+
repo.getBranchCommit(fromBranch)
549549
]);
550550
}).then(function(branchCommits) {
551-
var fromCommitOid = branchCommits[0].toString();
552-
var toCommitOid = branchCommits[1].toString();
551+
var toCommitOid = branchCommits[0].toString();
552+
var fromCommitOid = branchCommits[1].toString();
553553

554554
return NodeGit.Merge.base(repo, toCommitOid, fromCommitOid)
555555
.then(function(baseCommit) {
@@ -592,10 +592,11 @@ Repository.prototype.mergeBranches = function(to, from) {
592592
fromBranch.shorthand() +
593593
" into " +
594594
toBranch.shorthand();
595+
console.log(message);
595596
var sig = repo.defaultSignature();
596597

597598
return repo.createCommit(
598-
toBranch.shorthand(),
599+
toBranch.name(),
599600
sig,
600601
sig,
601602
message,

test/tests/merge.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ describe("Merge", function() {
225225
});
226226
});
227227

228-
it.only("can merge using the convenience method", function() {
228+
it.only("can merge cleanly using the convenience method", function() {
229229
var initialFileName = "initialFile.txt";
230230
var ourFileName = "ourNewFile.txt";
231231
var theirFileName = "theirNewFile.txt";
@@ -303,11 +303,11 @@ describe("Merge", function() {
303303
"af60aa06b3537f75b427f6268a130c842c84a137");
304304

305305
return repository.createCommit(ourBranch.name(), ourSignature,
306-
ourSignature, "we made a commit", oid, [initialCommit]);
306+
ourSignature, "we made a commit", oid, [initialCommit]);
307307
})
308308
.then(function(commitOid) {
309309
assert.equal(commitOid.toString(),
310-
"7ce31c05427659986d50abfb90c8f7db88ef4fa1");
310+
"7ce31c05427659986d50abfb90c8f7db88ef4fa1");
311311

312312
return repository.getCommit(commitOid).then(function(commit) {
313313
ourCommit = commit;
@@ -343,7 +343,7 @@ describe("Merge", function() {
343343
});
344344
})
345345
.then(function() {
346-
return repository.mergeBranches(theirBranchName, ourBranchName);
346+
return repository.mergeBranches(ourBranchName, theirBranchName);
347347
})
348348
.then(function(commitId) {
349349
assert.equal(commitId.toString(),

0 commit comments

Comments
 (0)