Skip to content

Commit 90f7bab

Browse files
committed
some improvements
1 parent 77d8896 commit 90f7bab

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/integration/repo_webhook_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -370,13 +370,13 @@ func Test_WebhookPush(t *testing.T) {
370370
assert.NoError(t, err)
371371
defer gitRepo.Close()
372372

373-
beforeCommitID, err := gitRepo.GetRefCommitID("master")
373+
beforeCommitID, err := gitRepo.GetBranchCommitID("master")
374374
assert.NoError(t, err)
375375

376376
// 2. trigger the webhook
377377
testCreateFile(t, session, "user2", "repo1", "master", "test_webhook_push.md", "# a test file for webhook push", "")
378378

379-
afterCommitID, err := gitRepo.GetRefCommitID("master")
379+
afterCommitID, err := gitRepo.GetBranchCommitID("master")
380380
assert.NoError(t, err)
381381

382382
// 3. validate the webhook is triggered
@@ -426,16 +426,16 @@ func Test_WebhookPushDevBranch(t *testing.T) {
426426
assert.Empty(t, triggeredEvent)
427427
assert.Empty(t, payloads)
428428

429-
_, err = gitRepo.GetRefCommitID("new_branch")
429+
_, err = gitRepo.GetBranchCommitID("new_branch")
430430
assert.Error(t, err)
431431

432-
fromBranchCommitID, err := gitRepo.GetRefCommitID("develop")
432+
fromBranchCommitID, err := gitRepo.GetBranchCommitID("develop")
433433
assert.NoError(t, err)
434434

435435
// 3. trigger the webhook
436436
testCreateFile(t, session, "user2", "repo1", "develop", "test_webhook_push.md", "# a test file for webhook push", "new_branch")
437437

438-
afterCommitID, err := gitRepo.GetRefCommitID("new_branch")
438+
afterCommitID, err := gitRepo.GetBranchCommitID("new_branch")
439439
assert.NoError(t, err)
440440

441441
beforeCommitID := git.Sha1ObjectFormat.EmptyObjectID().String()

0 commit comments

Comments
 (0)