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 Apr 12, 2022
1 parent dfa2b21 commit 90d5e6a
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 90d5e6a

Please sign in to comment.