We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d05ad4 commit 922fd8bCopy full SHA for 922fd8b
modules/git/batch_reader.go
@@ -27,6 +27,9 @@ type WriteCloserError interface {
27
CloseWithError(err error) error
28
}
29
30
+// EnsureValidGitRepository runs git rev-parse in the repository path - thus ensuring that the repository is a valid repository.
31
+// Run before opening git cat-file.
32
+// This is needed otherwise the git cat-file will hang for invalid repositories.
33
func EnsureValidGitRepository(ctx context.Context, repoPath string) error {
34
stderr := strings.Builder{}
35
err := NewCommandContext(ctx, "rev-parse").
0 commit comments