Skip to content

Commit 0393bfc

Browse files
committed
some improvements
1 parent bea4f6e commit 0393bfc

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
@@ -371,13 +371,13 @@ func Test_WebhookPush(t *testing.T) {
371371
assert.NoError(t, err)
372372
defer gitRepo.Close()
373373

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

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)