Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move git update-server-info to hooks #12826

Merged
merged 5 commits into from
Oct 13, 2020
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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