diff --git a/cmd/hook.go b/cmd/hook.go index cc5289db6..1fcc0a18c 100644 --- a/cmd/hook.go +++ b/cmd/hook.go @@ -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 } diff --git a/services/repository/push.go b/services/repository/push.go index bd7ebe674..762136fd0 100644 --- a/services/repository/push.go +++ b/services/repository/push.go @@ -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)