@@ -134,3 +134,27 @@ func TestPullCreate_EmptyChangesWithDifferentCommits(t *testing.T) {
134
134
assert .Contains (t , text , "This pull request can be merged automatically." )
135
135
})
136
136
}
137
+
138
+ func TestPullCreate_EmptyChangesWithSameCommits (t * testing.T ) {
139
+ onGiteaRun (t , func (t * testing.T , u * url.URL ) {
140
+ session := loginUser (t , "user1" )
141
+ testRepoFork (t , session , "user2" , "repo1" , "user1" , "repo1" )
142
+ testCreateBranch (t , session , "user1" , "repo1" , "branch/master" , "status1" , http .StatusSeeOther )
143
+
144
+ url := path .Join ("user1" , "repo1" , "compare" , "master...status1" )
145
+ req := NewRequestWithValues (t , "POST" , url ,
146
+ map [string ]string {
147
+ "_csrf" : GetCSRF (t , session , url ),
148
+ "title" : "pull request from status1" ,
149
+ },
150
+ )
151
+ session .MakeRequest (t , req , http .StatusSeeOther )
152
+
153
+ req = NewRequest (t , "GET" , "/user1/repo1/pulls/1" )
154
+ resp := session .MakeRequest (t , req , http .StatusOK )
155
+ doc := NewHTMLParser (t , resp .Body )
156
+
157
+ text := strings .TrimSpace (doc .doc .Find (".merge-section" ).Text ())
158
+ assert .Contains (t , text , "This branch is equal with the target branch." )
159
+ })
160
+ }
0 commit comments