Skip to content

Commit

Permalink
Integration Test for Commit Search containing Square Brackets (go-git…
Browse files Browse the repository at this point in the history
…ea#28751)

Integration test for go-gitea#28744 

Change keywords commit search flag from `-F` to `--fixed-strings` for
readability
  • Loading branch information
me-heer authored and silverwind committed Feb 20, 2024
1 parent 15289c6 commit 97c69bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion modules/git/repo_commit.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ func (repo *Repository) searchCommits(id ObjectID, opts SearchCommitsOptions) ([
}

// interpret search string keywords as string instead of regex
cmd.AddArguments("-F")
cmd.AddArguments("--fixed-strings")

// add remaining keywords from search string
// note this is done only for command created above
Expand Down
1 change: 1 addition & 0 deletions tests/integration/repo_commits_search_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ func TestRepoCommitsSearch(t *testing.T) {
testRepoCommitsSearch(t, "38a9cb", "")
testRepoCommitsSearch(t, "6e8e", "6e8eabd9a7")
testRepoCommitsSearch(t, "58e97", "58e97d1a24")
testRepoCommitsSearch(t, "[build]", "")
testRepoCommitsSearch(t, "author:alice", "6e8eabd9a7")
testRepoCommitsSearch(t, "author:alice 6e8ea", "6e8eabd9a7")
testRepoCommitsSearch(t, "committer:Tom", "58e97d1a24")
Expand Down

0 comments on commit 97c69bf

Please sign in to comment.