Skip to content

Commit

Permalink
Improve input validation
Browse files Browse the repository at this point in the history
  • Loading branch information
doriable committed May 15, 2024
1 parent 38d44d2 commit 37a1e88
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion private/buf/cmd/buf/command/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,8 @@ func getGitMetadataUploadOptions(
return nil, err
}
// validate that input is a local directory
if _, err := os.Stat(input); err != nil {
fileInfo, err := os.Stat(input)
if err != nil || !fileInfo.IsDir() {
return nil, appcmd.NewInvalidArgumentErrorf("input, %s, must be a local Git repository checkout: %w", input, err)
}
runner := command.NewRunner()
Expand Down

0 comments on commit 37a1e88

Please sign in to comment.