Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/GitVersionCore/Extensions/ArgumentExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,7 @@ public static string GetDotGitDirectory(this Arguments arguments)

public static string GetProjectRootDirectory(this Arguments arguments)
{
if (arguments.IsDynamicGitRepository())
{
return arguments.GetWorkingDirectory();
}

var dotGitDirectory = Repository.Discover(arguments.GetWorkingDirectory());
var dotGitDirectory = Repository.Discover(arguments.IsDynamicGitRepository() ? arguments.DynamicGitRepositoryPath : arguments.GetWorkingDirectory());

if (string.IsNullOrEmpty(dotGitDirectory))
throw new DirectoryNotFoundException($"Can't find the .git directory in {dotGitDirectory}");
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersionCore/GitVersionCalculator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private VersionVariables ExecuteInternal(Arguments arguments)
{
var configuration = configProvider.Provide(overrideConfig: arguments.OverrideConfig);

using var repo = new Repository(arguments.GetDotGitDirectory());
using var repo = new Repository(arguments.GetProjectRootDirectory());
var targetBranch = repo.GetTargetBranch(arguments.TargetBranch);
var gitVersionContext = new GitVersionContext(repo, log, targetBranch, configuration, commitId: arguments.CommitId);
var semanticVersion = nextVersionCalculator.FindVersion(gitVersionContext);
Expand Down