Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Fix checkout bug in GitRepositoryHelper #39

Merged
merged 2 commits into from
Feb 28, 2017
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
install:
- choco install gitversion.portable -pre -y
- cinst gitlink -pre -y
- cinst gitlink -y

platform:
- Any CPU
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,17 @@ static void EnsureLocalBranchExistsForCurrentBranch(Repository repo, string curr
var isRef = currentBranch.Contains("refs");
var isBranch = currentBranch.Contains("refs/heads");
var localCanonicalName = !isRef ? "refs/heads/" + currentBranch : isBranch ? currentBranch : currentBranch.Replace("refs/", "refs/heads/");

var repoTip = repo.Head.Tip;

// We currently have the rep.Head of the *default* branch, now we need to look up the right one
var originCanonicalName = string.Format("origin/{0}", currentBranch);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should update this to use remote.Name like everywhere else in this file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JakeGinnivan Good point, will fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

var originBranch = repo.Branches[originCanonicalName];
if (originBranch != null)
{
repoTip = originBranch.Tip;
}

var repoTipId = repoTip.Id;

if (repo.Branches.All(b => b.CanonicalName != localCanonicalName))
Expand Down