Skip to content

Commit

Permalink
(deps): Bump LibGit2Sharp from 0.30.0 to 0.31.0 in /src
Browse files Browse the repository at this point in the history
Bumps [LibGit2Sharp](https://github.com/libgit2/libgit2sharp) from 0.30.0 to 0.31.0.
- [Release notes](https://github.com/libgit2/libgit2sharp/releases)
- [Changelog](https://github.com/libgit2/libgit2sharp/blob/master/CHANGES.md)
- [Commits](libgit2/libgit2sharp@0.30.0...0.31.0)

---
updated-dependencies:
- dependency-name: LibGit2Sharp
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
  • Loading branch information
dependabot[bot] authored and arturcic committed Dec 4, 2024
1 parent 6f024d2 commit 1e9f2fd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</PropertyGroup>
<ItemGroup>
<!-- common packages -->
<PackageVersion Include="LibGit2Sharp" Version="0.30.0" />
<PackageVersion Include="LibGit2Sharp" Version="0.31.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Common" Version="4.11.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.11.0" />
Expand Down
2 changes: 1 addition & 1 deletion src/GitVersion.App.Tests/ExecCmdLineArgumentTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void WorkingDirectoryWithoutGitFolderFailsWithInformativeMessage()

result.ExitCode.ShouldNotBe(0);
result.Output.ShouldNotBeNull();
result.Output.ShouldContain("Cannot find the .git directory");
result.Output.ShouldContain("failed to resolve path");
}

[TestCase(" -help")]
Expand Down
14 changes: 9 additions & 5 deletions src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,9 @@ public GitRepositoryInfo(IOptions<GitVersionOptions> options)
: Repository.Discover(gitVersionOptions.WorkingDirectory);

gitDirectory = gitDirectory?.TrimEnd('/', '\\');
if (gitDirectory.IsNullOrEmpty())
throw new DirectoryNotFoundException("Cannot find the .git directory");
EnsureGitDirectory(gitDirectory);

var directoryInfo = Directory.GetParent(gitDirectory) ?? throw new DirectoryNotFoundException("Cannot find the .git directory");
var directoryInfo = Directory.GetParent(gitDirectory) ?? throw new DirectoryNotFoundException();

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Prepare / ubuntu-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Prepare / ubuntu-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Prepare / macos-15

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Prepare / macos-15

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Prepare / windows-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Prepare / windows-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Analyze (csharp)

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / macos-15 - net8.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / macos-15 - net8.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / macos-15 - net8.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / macos-15 - net8.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / macos-15 - net9.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / macos-15 - net9.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / macos-15 - net9.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / macos-15 - net9.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / ubuntu-latest - net9.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / ubuntu-latest - net9.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / ubuntu-latest - net9.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / ubuntu-latest - net9.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / ubuntu-latest - net8.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / ubuntu-latest - net8.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / ubuntu-latest - net8.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / ubuntu-latest - net8.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / macos-15

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / macos-15

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / macos-15

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / macos-15

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / macos-15

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / macos-15

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / macos-15

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / ubuntu-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / ubuntu-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / ubuntu-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / ubuntu-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / ubuntu-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / ubuntu-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / ubuntu-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / windows-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / windows-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / windows-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / windows-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / windows-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / windows-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Build & Package / windows-latest

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / windows-latest - net9.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / windows-latest - net9.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / windows-latest - net9.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / windows-latest - net9.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / windows-latest - net8.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / windows-latest - net8.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / windows-latest - net8.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.

Check warning on line 71 in src/GitVersion.LibGit2Sharp/Git/GitRepositoryInfo.cs

View workflow job for this annotation

GitHub Actions / Test / windows-latest - net8.0

Possible null reference argument for parameter 'path' in 'DirectoryInfo? Directory.GetParent(string path)'.
return gitDirectory.Contains(PathHelper.Combine(".git", "worktrees"))
? Directory.GetParent(directoryInfo.FullName)?.FullName
: gitDirectory;
Expand All @@ -84,8 +83,7 @@ private string GetProjectRootDirectory()

var gitDirectory = Repository.Discover(gitVersionOptions.WorkingDirectory);

if (gitDirectory.IsNullOrEmpty())
throw new DirectoryNotFoundException("Cannot find the .git directory");
EnsureGitDirectory(gitDirectory);

return new Repository(gitDirectory).Info.WorkingDirectory;
}
Expand All @@ -110,4 +108,10 @@ private static bool GitRepoHasMatchingRemote(string possiblePath, string targetU
return false;
}
}

private static void EnsureGitDirectory(string? gitDirectory)
{
if (gitDirectory.IsNullOrWhiteSpace())
throw new DirectoryNotFoundException("Cannot find the .git directory");
}
}

0 comments on commit 1e9f2fd

Please sign in to comment.