Skip to content

Commit

Permalink
Produce absolute path per api doc when reading version file
Browse files Browse the repository at this point in the history
Fixes #573
  • Loading branch information
AArnott committed Mar 29, 2021
1 parent d7059f7 commit 55c2681
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/NerdBank.GitVersioning/LibGit2/LibGit2VersionFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ internal LibGit2VersionFile(LibGit2Context context)

if (result is object)
{
actualDirectory = searchDirectory;
IBelongToARepository commitAsRepoMember = commit;
actualDirectory = Path.Combine(commitAsRepoMember.Repository.Info.WorkingDirectory, searchDirectory);
return result;
}
}
Expand Down Expand Up @@ -125,7 +126,8 @@ internal LibGit2VersionFile(LibGit2Context context)
}
else if (result is object)
{
actualDirectory = searchDirectory;
IBelongToARepository commitAsRepoMember = commit;
actualDirectory = Path.Combine(commitAsRepoMember.Repository.Info.WorkingDirectory, searchDirectory);
return result;
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/NerdBank.GitVersioning/Managed/ManagedVersionFile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public ManagedVersionFile(GitContext context)
if (result is object)
{
finalResult = result;
actualDirectory = searchDirectory;
actualDirectory = Path.Combine(this.Context.WorkingTreePath, searchDirectory);
}
}

Expand Down Expand Up @@ -158,7 +158,7 @@ public ManagedVersionFile(GitContext context)

if (result is object)
{
actualDirectory = searchDirectory;
actualDirectory = Path.Combine(this.Context.WorkingTreePath, searchDirectory);
finalResult = result;
}
}
Expand Down

0 comments on commit 55c2681

Please sign in to comment.