Skip to content

Commit 97c69bf

Browse files
me-heersilverwind
authored andcommitted
Integration Test for Commit Search containing Square Brackets (go-gitea#28751)
Integration test for go-gitea#28744 Change keywords commit search flag from `-F` to `--fixed-strings` for readability
1 parent 15289c6 commit 97c69bf

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

modules/git/repo_commit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func (repo *Repository) searchCommits(id ObjectID, opts SearchCommitsOptions) ([
143143
}
144144

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

148148
// add remaining keywords from search string
149149
// note this is done only for command created above

tests/integration/repo_commits_search_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ func TestRepoCommitsSearch(t *testing.T) {
3232
testRepoCommitsSearch(t, "38a9cb", "")
3333
testRepoCommitsSearch(t, "6e8e", "6e8eabd9a7")
3434
testRepoCommitsSearch(t, "58e97", "58e97d1a24")
35+
testRepoCommitsSearch(t, "[build]", "")
3536
testRepoCommitsSearch(t, "author:alice", "6e8eabd9a7")
3637
testRepoCommitsSearch(t, "author:alice 6e8ea", "6e8eabd9a7")
3738
testRepoCommitsSearch(t, "committer:Tom", "58e97d1a24")

0 commit comments

Comments
 (0)