Skip to content

Commit

Permalink
test: debug log
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfogre committed Mar 1, 2024
1 parent 4fb19f7 commit 62d3cfa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
9 changes: 9 additions & 0 deletions routers/private/hook_post_receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"net/http"
"strconv"
"time"

issues_model "code.gitea.io/gitea/models/issues"
repo_model "code.gitea.io/gitea/models/repo"
Expand All @@ -24,6 +25,9 @@ import (

// HookPostReceive updates services and users
func HookPostReceive(ctx *gitea_context.PrivateContext) {
// TODO: remove debug code
log.Info("Debug git hook, HookPostReceive: %v", time.Now().Format(time.RFC3339Nano))

opts := web.GetForm(ctx).(*private.HookOptions)

// We don't rely on RepoAssignment here because:
Expand Down Expand Up @@ -93,6 +97,8 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) {
})
return
}
// TODO: remove debug code
log.Info("Debug git hook, before sync %v branches: %v", len(updates), time.Now().Format(time.RFC3339Nano))

for _, update := range updates {
if !update.RefFullName.IsBranch() {
Expand Down Expand Up @@ -133,6 +139,9 @@ func HookPostReceive(ctx *gitea_context.PrivateContext) {
}
}
}

// TODO: remove debug code
log.Info("Debug git hook, after sync %v branches: %v", len(updates), time.Now().Format(time.RFC3339Nano))
}

// Handle Push Options
Expand Down
4 changes: 4 additions & 0 deletions routers/private/hook_pre_receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"
"net/http"
"os"
"time"

"code.gitea.io/gitea/models"
asymkey_model "code.gitea.io/gitea/models/asymkey"
Expand Down Expand Up @@ -103,6 +104,9 @@ func (ctx *preReceiveContext) AssertCreatePullRequest() bool {

// HookPreReceive checks whether a individual commit is acceptable
func HookPreReceive(ctx *gitea_context.PrivateContext) {
// TODO: remove debug code
log.Info("Debug git hook, HookPreReceive: %v", time.Now().Format(time.RFC3339Nano))

opts := web.GetForm(ctx).(*private.HookOptions)

ourCtx := &preReceiveContext{
Expand Down

0 comments on commit 62d3cfa

Please sign in to comment.