mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-03 20:36:07 +01:00 
			
		
		
		
	Integration Test for Commit Search containing Square Brackets (#28751)
Integration test for #28744 Change keywords commit search flag from `-F` to `--fixed-strings` for readability
This commit is contained in:
		@@ -143,7 +143,7 @@ func (repo *Repository) searchCommits(id ObjectID, opts SearchCommitsOptions) ([
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// interpret search string keywords as string instead of regex
 | 
						// interpret search string keywords as string instead of regex
 | 
				
			||||||
	cmd.AddArguments("-F")
 | 
						cmd.AddArguments("--fixed-strings")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// add remaining keywords from search string
 | 
						// add remaining keywords from search string
 | 
				
			||||||
	// note this is done only for command created above
 | 
						// note this is done only for command created above
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -32,6 +32,7 @@ func TestRepoCommitsSearch(t *testing.T) {
 | 
				
			|||||||
	testRepoCommitsSearch(t, "38a9cb", "")
 | 
						testRepoCommitsSearch(t, "38a9cb", "")
 | 
				
			||||||
	testRepoCommitsSearch(t, "6e8e", "6e8eabd9a7")
 | 
						testRepoCommitsSearch(t, "6e8e", "6e8eabd9a7")
 | 
				
			||||||
	testRepoCommitsSearch(t, "58e97", "58e97d1a24")
 | 
						testRepoCommitsSearch(t, "58e97", "58e97d1a24")
 | 
				
			||||||
 | 
						testRepoCommitsSearch(t, "[build]", "")
 | 
				
			||||||
	testRepoCommitsSearch(t, "author:alice", "6e8eabd9a7")
 | 
						testRepoCommitsSearch(t, "author:alice", "6e8eabd9a7")
 | 
				
			||||||
	testRepoCommitsSearch(t, "author:alice 6e8ea", "6e8eabd9a7")
 | 
						testRepoCommitsSearch(t, "author:alice 6e8ea", "6e8eabd9a7")
 | 
				
			||||||
	testRepoCommitsSearch(t, "committer:Tom", "58e97d1a24")
 | 
						testRepoCommitsSearch(t, "committer:Tom", "58e97d1a24")
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user