Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

probe if sha before exec git #21467

Merged
merged 10 commits into from
Oct 17, 2022
2 changes: 1 addition & 1 deletion modules/git/repo_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (repo *Repository) searchCommits(id SHA1, opts SearchCommitsOptions) ([]*Co
if len(opts.Keywords) > 0 {
for _, v := range opts.Keywords {
// ignore anything below 4 characters as too unspecific
if len(v) >= 4 {
if len(v) >= 4 && IsValidSHAPattern(v) {
lunny marked this conversation as resolved.
Show resolved Hide resolved
// create new git log command with 1 commit limit
hashCmd := NewCommand(repo.Ctx, "log", "-1", prettyLogFormat)
// add previous arguments except for --grep and --all
Expand Down