Skip to content

Commit 922fd8b

Browse files
committed
placate lint
Signed-off-by: Andrew Thornton <[email protected]>
1 parent 2d05ad4 commit 922fd8b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/git/batch_reader.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ type WriteCloserError interface {
2727
CloseWithError(err error) error
2828
}
2929

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.
3033
func EnsureValidGitRepository(ctx context.Context, repoPath string) error {
3134
stderr := strings.Builder{}
3235
err := NewCommandContext(ctx, "rev-parse").

0 commit comments

Comments
 (0)