Skip to content

Commit 981c4f6

Browse files
Removed not required code from GitPreparer
1 parent 20c935d commit 981c4f6

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

GitVersion/GitPreparer.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,19 +81,7 @@ private string GetGitInfoFromUrl()
8181
{
8282
Logger.WriteInfo(string.Format("Switching to branch '{0}'", BranchName));
8383

84-
var branch = repository.FindBranch(BranchName);
85-
if ((branch != null) && !branch.IsCurrentRepositoryHead)
86-
{
87-
// Option 1: checkout (slow)
88-
//repository.Checkout(branch, CheckoutModifiers.Force, null, null);
89-
90-
// Option 2: add head refs
91-
//var finalName = string.Format("refs/heads/{0}", BranchName);
92-
//repository.Refs.Add("HEAD", finalName, true);
93-
94-
// Option 3: replace head
95-
repository.Refs.UpdateTarget("HEAD", branch.CanonicalName);
96-
}
84+
repository.Refs.UpdateTarget("HEAD", targetBranchName);
9785
}
9886
}
9987
}

0 commit comments

Comments
 (0)