Skip to content

Commit adcf9bf

Browse files
committed
remove libgit obsoletes
1 parent c41cc0f commit adcf9bf

14 files changed

+27
-27
lines changed

src/GitVersionCore.Tests/IntegrationTests/HotfixBranchScenarios.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void CanTakeVersionFromHotfixesBranch()
5757

5858
// Merge hotfix branch to support
5959
fixture.Repository.Checkout("master");
60-
fixture.Repository.Checkout(fixture.Repository.CreateBranch("support-1.1", (Commit)fixture.Repository.Tags.Single(t => t.Name == "1.1.0").Target));
60+
fixture.Repository.Checkout(fixture.Repository.CreateBranch("support-1.1", (Commit)fixture.Repository.Tags.Single(t => t.FriendlyName == "1.1.0").Target));
6161
fixture.AssertFullSemver("1.1.0");
6262

6363
// create hotfix branch

src/GitVersionCore.Tests/Mocks/MockBranch.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public MockBranch()
2323
MockCommitLog commits = new MockCommitLog();
2424
string name;
2525
string canonicalName;
26-
public override string Name { get { return name; } }
26+
public override string FriendlyName { get { return name; } }
2727
public override ICommitLog Commits { get { return commits; } }
2828
public override Commit Tip { get { return commits.First(); } }
2929
public override bool IsTracking { get { return true; } }

src/GitVersionCore.Tests/Mocks/MockBranchCollection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public override IEnumerator<Branch> GetEnumerator()
1313

1414
public override Branch this[string name]
1515
{
16-
get { return Branches.FirstOrDefault(x => x.Name == name); }
16+
get { return Branches.FirstOrDefault(x => x.FriendlyName == name); }
1717
}
1818

1919
public void Add(Branch item)

src/GitVersionCore.Tests/Mocks/MockTag.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public class MockTag : Tag
44
{
55

66
public string NameEx;
7-
public override string Name
7+
public override string FriendlyName
88
{
99
get { return NameEx; }
1010
}

src/GitVersionCore/BranchConfigurationCalculator.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static KeyValuePair<string, BranchConfig> GetBranchConfiguration(Commit c
3535
}
3636

3737
const string format = "Multiple branch configurations match the current branch branchName of '{0}'. Matching configurations: '{1}'";
38-
throw new Exception(string.Format(format, currentBranch.Name, string.Join(", ", matchingBranches.Select(b => b.Key))));
38+
throw new Exception(string.Format(format, currentBranch.FriendlyName, string.Join(", ", matchingBranches.Select(b => b.Key))));
3939
}
4040

4141
static KeyValuePair<string, BranchConfig>[] LookupBranchConfiguration([NotNull] Config config, [NotNull] Branch currentBranch)
@@ -50,7 +50,7 @@ static KeyValuePair<string, BranchConfig>[] LookupBranchConfiguration([NotNull]
5050
throw new ArgumentNullException("currentBranch");
5151
}
5252

53-
return config.Branches.Where(b => Regex.IsMatch(currentBranch.Name, "^" + b.Key, RegexOptions.IgnoreCase)).ToArray();
53+
return config.Branches.Where(b => Regex.IsMatch(currentBranch.FriendlyName, "^" + b.Key, RegexOptions.IgnoreCase)).ToArray();
5454
}
5555

5656

@@ -104,7 +104,7 @@ static KeyValuePair<string, BranchConfig> InheritBranchConfiguration(bool onlyEv
104104
}
105105
}
106106

107-
Logger.WriteInfo("Found possible parent branches: " + string.Join(", ", possibleParents.Select(p => p.Name)));
107+
Logger.WriteInfo("Found possible parent branches: " + string.Join(", ", possibleParents.Select(p => p.FriendlyName)));
108108

109109
if (possibleParents.Count == 1)
110110
{
@@ -124,14 +124,14 @@ static KeyValuePair<string, BranchConfig> InheritBranchConfiguration(bool onlyEv
124124
if (possibleParents.Count == 0)
125125
errorMessage = "Failed to inherit Increment branch configuration, no branches found.";
126126
else
127-
errorMessage = "Failed to inherit Increment branch configuration, ended up with: " + string.Join(", ", possibleParents.Select(p => p.Name));
127+
errorMessage = "Failed to inherit Increment branch configuration, ended up with: " + string.Join(", ", possibleParents.Select(p => p.FriendlyName));
128128

129-
var chosenBranch = repository.Branches.FirstOrDefault(b => Regex.IsMatch(b.Name, "^develop", RegexOptions.IgnoreCase)
130-
|| Regex.IsMatch(b.Name, "master$", RegexOptions.IgnoreCase));
129+
var chosenBranch = repository.Branches.FirstOrDefault(b => Regex.IsMatch(b.FriendlyName, "^develop", RegexOptions.IgnoreCase)
130+
|| Regex.IsMatch(b.FriendlyName, "master$", RegexOptions.IgnoreCase));
131131
if (chosenBranch == null)
132132
throw new InvalidOperationException("Could not find a 'develop' or 'master' branch, neither locally nor remotely.");
133133

134-
var branchName = chosenBranch.Name;
134+
var branchName = chosenBranch.FriendlyName;
135135
Logger.WriteWarning(errorMessage + Environment.NewLine + Environment.NewLine + "Falling back to " + branchName + " branch config");
136136

137137
var value = GetBranchConfiguration(currentCommit, repository, onlyEvaluateTrackedBranches, config, chosenBranch).Value;
@@ -161,22 +161,22 @@ static Branch[] CalculateWhenMultipleParents(IRepository repository, Commit curr
161161
}
162162
else if (branches.Count > 1)
163163
{
164-
currentBranch = branches.FirstOrDefault(b => b.Name == "master") ?? branches.First();
164+
currentBranch = branches.FirstOrDefault(b => b.FriendlyName == "master") ?? branches.First();
165165
}
166166
else
167167
{
168168
var possibleTargetBranches = repository.Branches.Where(b => !b.IsRemote && b.Tip == parents[0]).ToList();
169169
if (possibleTargetBranches.Count > 1)
170170
{
171-
currentBranch = possibleTargetBranches.FirstOrDefault(b => b.Name == "master") ?? possibleTargetBranches.First();
171+
currentBranch = possibleTargetBranches.FirstOrDefault(b => b.FriendlyName == "master") ?? possibleTargetBranches.First();
172172
}
173173
else
174174
{
175175
currentBranch = possibleTargetBranches.FirstOrDefault() ?? currentBranch;
176176
}
177177
}
178178

179-
Logger.WriteInfo("HEAD is merge commit, this is likely a pull request using " + currentBranch.Name + " as base");
179+
Logger.WriteInfo("HEAD is merge commit, this is likely a pull request using " + currentBranch.FriendlyName + " as base");
180180

181181
return excludedBranches;
182182
}

src/GitVersionCore/GitVersionContext.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public GitVersionContext(IRepository repository, Branch currentBranch, Config co
6161
.SelectMany(t =>
6262
{
6363
SemanticVersion version;
64-
if (t.PeeledTarget() == CurrentCommit && SemanticVersion.TryParse(t.Name, Configuration.GitTagPrefix, out version))
64+
if (t.PeeledTarget() == CurrentCommit && SemanticVersion.TryParse(t.FriendlyName, Configuration.GitTagPrefix, out version))
6565
return new[] { version };
6666
return new SemanticVersion[0];
6767
})

src/GitVersionCore/GitVersionFinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class GitVersionFinder
88
{
99
public SemanticVersion FindVersion(GitVersionContext context)
1010
{
11-
Logger.WriteInfo(string.Format("Running against branch: {0} ({1})", context.CurrentBranch.Name, context.CurrentCommit.Sha));
11+
Logger.WriteInfo(string.Format("Running against branch: {0} ({1})", context.CurrentBranch.FriendlyName, context.CurrentCommit.Sha));
1212
EnsureMainTopologyConstraints(context);
1313

1414
var filePath = Path.Combine(context.Repository.GetRepositoryDirectory(), "NextVersion.txt");

src/GitVersionCore/IncrementStrategyFinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ private static IEnumerable<Commit> GetIntermediateCommits(IRepository repo, Comm
8787
{
8888
var filter = new CommitFilter
8989
{
90-
Since = headCommit,
90+
IncludeReachableFrom = headCommit,
9191
SortBy = CommitSortStrategies.Topological | CommitSortStrategies.Reverse
9292
};
9393

src/GitVersionCore/VersionCalculation/BaseVersionCalculators/TaggedCommitVersionStrategy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ public override IEnumerable<BaseVersion> GetVersions(GitVersionContext context)
2121
.Select(t =>
2222
{
2323
SemanticVersion version;
24-
if (SemanticVersion.TryParse(t.Name, context.Configuration.GitTagPrefix, out version))
24+
if (SemanticVersion.TryParse(t.FriendlyName, context.Configuration.GitTagPrefix, out version))
2525
{
2626
var commit = t.PeeledTarget() as Commit;
2727
if (commit != null)
28-
return new VersionTaggedCommit(commit, version, t.Name);
28+
return new VersionTaggedCommit(commit, version, t.FriendlyName);
2929
}
3030
return null;
3131
})

src/GitVersionCore/VersionCalculation/BaseVersionCalculators/VersionInBranchBaseVersionStrategy.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ public override IEnumerable<BaseVersion> GetVersions(GitVersionContext context)
1111
if (versionInBranch != null)
1212
{
1313
var commitBranchWasBranchedFrom = context.CurrentBranch.FindCommitBranchWasBranchedFrom(context.Repository);
14-
var branchNameOverride = context.CurrentBranch.Name.RegexReplace("[-/]" + versionInBranch.Item1, string.Empty);
14+
var branchNameOverride = context.CurrentBranch.FriendlyName.RegexReplace("[-/]" + versionInBranch.Item1, string.Empty);
1515
yield return new BaseVersion("Version in branch name", false, versionInBranch.Item2, commitBranchWasBranchedFrom, branchNameOverride);
1616
}
1717
}
1818

1919
Tuple<string, SemanticVersion> GetVersionInBranch(GitVersionContext context)
2020
{
21-
var branchParts = context.CurrentBranch.Name.Split('/', '-');
21+
var branchParts = context.CurrentBranch.FriendlyName.Split('/', '-');
2222
foreach (var part in branchParts)
2323
{
2424
SemanticVersion semanticVersion;

src/GitVersionCore/VersionCalculation/FallbackBaseVersionStrategy.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public override IEnumerable<BaseVersion> GetVersions(GitVersionContext context)
1111
{
1212
var baseVersionSource = context.Repository.Commits.QueryBy(new CommitFilter
1313
{
14-
Since = context.CurrentBranch.Tip
14+
IncludeReachableFrom = context.CurrentBranch.Tip
1515
}).First(c => !c.Parents.Any());
1616
yield return new BaseVersion("Fallback base version", false, new SemanticVersion(minor: 1), baseVersionSource, null);
1717
}

src/GitVersionCore/VersionCalculation/MetaDataCalculator.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ public SemanticVersionBuildMetaData Create(Commit baseVersionSource, GitVersionC
99
{
1010
var qf = new CommitFilter
1111
{
12-
Since = context.CurrentCommit,
13-
Until = baseVersionSource,
12+
IncludeReachableFrom = context.CurrentCommit,
13+
ExcludeReachableFrom = baseVersionSource,
1414
SortBy = CommitSortStrategies.Topological | CommitSortStrategies.Time
1515
};
1616

@@ -20,7 +20,7 @@ public SemanticVersionBuildMetaData Create(Commit baseVersionSource, GitVersionC
2020

2121
return new SemanticVersionBuildMetaData(
2222
commitsSinceTag,
23-
context.CurrentBranch.Name,
23+
context.CurrentBranch.FriendlyName,
2424
context.CurrentCommit.Sha,
2525
context.CurrentCommit.When());
2626
}

src/GitVersionCore/VersionCalculation/NextVersionCalculator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void UpdatePreReleaseTag(GitVersionContext context, SemanticVersion semanticVers
7777
{
7878
Logger.WriteInfo("Using branch name to calculate version tag");
7979

80-
var branchName = branchNameOverride ?? context.CurrentBranch.Name;
80+
var branchName = branchNameOverride ?? context.CurrentBranch.FriendlyName;
8181
if (!string.IsNullOrWhiteSpace(context.Configuration.BranchPrefixToTrim))
8282
{
8383
branchName = branchName.RegexReplace(context.Configuration.BranchPrefixToTrim, string.Empty, RegexOptions.IgnoreCase);

src/GitVersionCore/VersioningModes/ContinuousDeliveryMode.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ static SemanticVersionPreReleaseTag RetrieveMostRecentOptionalTagVersion(GitVers
1616
if (applicableTagsInDescendingOrder.Any())
1717
{
1818
var taggedCommit = applicableTagsInDescendingOrder.First().PeeledTarget();
19-
var preReleaseVersion = applicableTagsInDescendingOrder.Select(tag => SemanticVersion.Parse(tag.Name, context.Configuration.GitTagPrefix)).FirstOrDefault();
19+
var preReleaseVersion = applicableTagsInDescendingOrder.Select(tag => SemanticVersion.Parse(tag.FriendlyName, context.Configuration.GitTagPrefix)).FirstOrDefault();
2020
if (preReleaseVersion != null)
2121
{
2222
if (taggedCommit != context.CurrentCommit)

0 commit comments

Comments
 (0)