Skip to content

Commit 2d75d6f

Browse files
Move update-server-info to hooks (#12826)
Signed-off-by: Andrew Thornton <[email protected]> Co-authored-by: techknowlogick <[email protected]>
1 parent daa393c commit 2d75d6f

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

cmd/hook.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,12 @@ func runHookUpdate(c *cli.Context) error {
285285
}
286286

287287
func runHookPostReceive(c *cli.Context) error {
288+
// First of all run update-server-info no matter what
289+
if _, err := git.NewCommand("update-server-info").Run(); err != nil {
290+
return fmt.Errorf("Failed to call 'git update-server-info': %v", err)
291+
}
292+
293+
// Now if we're an internal don't do anything else
288294
if os.Getenv(models.EnvIsInternal) == "true" {
289295
return nil
290296
}

services/repository/push.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,6 @@ func pushUpdates(optsList []*PushUpdateOptions) error {
180180
}
181181

182182
repoPath := repo.RepoPath()
183-
_, err = git.NewCommand("update-server-info").RunInDir(repoPath)
184-
if err != nil {
185-
return fmt.Errorf("Failed to call 'git update-server-info': %v", err)
186-
}
187183
gitRepo, err := git.OpenRepository(repoPath)
188184
if err != nil {
189185
return fmt.Errorf("OpenRepository: %v", err)

0 commit comments

Comments
 (0)