Skip to content

Commit

Permalink
Fall back to master if main is missing
Browse files Browse the repository at this point in the history
Fall back to `master` if `main` is missing. Fixes GitToolsGH-2590.
  • Loading branch information
asbjornu committed Mar 9, 2022
1 parent 0a329cc commit 62377fc
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,13 @@ public override IEnumerable<BaseVersion> GetVersions() =>

private IEnumerable<BaseVersion> MainTagsVersions()
{
var main = this.repositoryStore.FindBranch(Config.MainBranchKey);
return main != null ? this.taggedCommitVersionStrategy.GetTaggedVersions(main, null) : Array.Empty<BaseVersion>();
var main = this.repositoryStore.FindBranch(Config.MainBranchKey)
// For compatibility reason try to find `master` if `main` cannot be found
?? this.repositoryStore.FindBranch(Config.MasterBranchKey);

return main != null
? this.taggedCommitVersionStrategy.GetTaggedVersions(main, null)
: Array.Empty<BaseVersion>();
}

private IEnumerable<BaseVersion> ReleaseBranchBaseVersions()
Expand Down

0 comments on commit 62377fc

Please sign in to comment.