Skip to content

Commit

Permalink
Move update-server-info to hooks (go-gitea#12826)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Thornton <[email protected]>

Co-authored-by: techknowlogick <[email protected]>
  • Loading branch information
zeripath and techknowlogick authored Oct 13, 2020
1 parent daa393c commit 2d75d6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 6 additions & 0 deletions cmd/hook.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ func runHookUpdate(c *cli.Context) error {
}

func runHookPostReceive(c *cli.Context) error {
// First of all run update-server-info no matter what
if _, err := git.NewCommand("update-server-info").Run(); err != nil {
return fmt.Errorf("Failed to call 'git update-server-info': %v", err)
}

// Now if we're an internal don't do anything else
if os.Getenv(models.EnvIsInternal) == "true" {
return nil
}
Expand Down
4 changes: 0 additions & 4 deletions services/repository/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,10 +180,6 @@ func pushUpdates(optsList []*PushUpdateOptions) error {
}

repoPath := repo.RepoPath()
_, err = git.NewCommand("update-server-info").RunInDir(repoPath)
if err != nil {
return fmt.Errorf("Failed to call 'git update-server-info': %v", err)
}
gitRepo, err := git.OpenRepository(repoPath)
if err != nil {
return fmt.Errorf("OpenRepository: %v", err)
Expand Down

0 comments on commit 2d75d6f

Please sign in to comment.