Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Repository.checkoutBranch does nothing if branch name matches tag name
Add a failing test wherein the existence of both a refs/heads/branch
branch reference and a refs/tags/branch tag reference will cause the
checkout to fail.
  • Loading branch information
rcjsuen committed Mar 11, 2017
commit 26ff3b7bfb2d3a66e57c71ef3aa2e296fcfb1bd4
23 changes: 23 additions & 0 deletions test/tests/checkout.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,29 @@ describe("Checkout", function() {
});
});

it("can checkout a branch with a name that conflicts with a tag", function() {
var test = this;
var commit;

return test.repository.getHeadCommit()
.then(function(headCommit) {
commit = headCommit;
return test.repository.createLightweightTag(commit.sha(), "conflict");
})
.then(function() {
return test.repository.createBranch("conflict", commit);
})
.then(function() {
return test.repository.checkoutBranch("conflict");
})
.then(function() {
return test.repository.head();
})
.then(function(ref) {
assert.equal(ref.name(), "refs/heads/conflict");
});
});

it("can checkout an index with conflicts", function() {
var test = this;

Expand Down