aboutsummaryrefslogtreecommitdiffstats
path: root/tests/integration/repo_commits_test.go
diff options
context:
space:
mode:
authorJason Song <i@wolfogre.com>2022-12-27 21:12:49 +0800
committerGitHub <noreply@github.com>2022-12-27 21:12:49 +0800
commit6cf09ccab402fe84a5313e1d3e755e284ebbc845 (patch)
treeb1fad807c2a16fded8b6bda84583c421ec86230c /tests/integration/repo_commits_test.go
parent90237d8abd0e6479c1464ac0f32fff6a2ce4a0b4 (diff)
downloadgitea-6cf09ccab402fe84a5313e1d3e755e284ebbc845.tar.gz
gitea-6cf09ccab402fe84a5313e1d3e755e284ebbc845.zip
Use complete SHA to create and query commit status (#22244)
Fix #13485. Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Lauris BH <lauris@nix.lv> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Diffstat (limited to 'tests/integration/repo_commits_test.go')
-rw-r--r--tests/integration/repo_commits_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/integration/repo_commits_test.go b/tests/integration/repo_commits_test.go
index 0d794cec75..ab90e72877 100644
--- a/tests/integration/repo_commits_test.go
+++ b/tests/integration/repo_commits_test.go
@@ -68,6 +68,11 @@ func doTestRepoCommitWithStatus(t *testing.T, state string, classes ...string) {
reqOne := NewRequest(t, "GET", "/api/v1/repos/user2/repo1/commits/"+path.Base(commitURL)+"/status")
testRepoCommitsWithStatus(t, session.MakeRequest(t, req, http.StatusOK), session.MakeRequest(t, reqOne, http.StatusOK), state)
+ // By short SHA
+ req = NewRequest(t, "GET", "/api/v1/repos/user2/repo1/commits/"+path.Base(commitURL)[:10]+"/statuses")
+ reqOne = NewRequest(t, "GET", "/api/v1/repos/user2/repo1/commits/"+path.Base(commitURL)[:10]+"/status")
+ testRepoCommitsWithStatus(t, session.MakeRequest(t, req, http.StatusOK), session.MakeRequest(t, reqOne, http.StatusOK), state)
+
// By Ref
req = NewRequest(t, "GET", "/api/v1/repos/user2/repo1/commits/master/statuses")
reqOne = NewRequest(t, "GET", "/api/v1/repos/user2/repo1/commits/master/status")