Skip to content

Commit e52cbec

Browse files
committed
deleting 'MissingBranchException as it is unused and been in the code base since 2014. As well as throwing an exception if Git repository is created without a target branch
1 parent 1ca6651 commit e52cbec

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

GitVersionCore/GitPreparer.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ public void Initialise(bool normaliseGitDirectory)
4343
}
4444

4545
var targetPath = CalculateTemporaryRepositoryPath(targetUrl, dynamicRepositoryLocation);
46+
4647
DynamicGitRepositoryPath = CreateDynamicRepository(targetPath, authentication, targetUrl, targetBranch, noFetch);
4748
if (normaliseGitDirectory)
4849
{
@@ -119,6 +120,10 @@ static string CreateDynamicRepository(string targetPath, Authentication authenti
119120
Logger.WriteInfo(string.Format("Updating branch '{0}'", targetBranch));
120121
using (var repo = new Repository(targetPath))
121122
{
123+
if (string.IsNullOrWhiteSpace(targetBranch))
124+
{
125+
throw new Exception("Dynamic Git repositories must have a target branch (/b)");
126+
}
122127
var targetGitBranch = repo.Branches[targetBranch];
123128
var trackedBranch = targetGitBranch.TrackedBranch;
124129
if (trackedBranch == null)

GitVersionCore/MissingBranchException.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)