Files
dokku/plugins/repo/subcommands.go
Jose Diaz-Gonzalez da166bc537 fix: restore the git head ref when running repo:gc
When git --aggressive is run on a bare repo, it deletes all head refs. This change copies the contents into memory and then writes them out at the end of the repo:gc call.

Closes #6973
2025-03-08 23:00:53 -05:00

24 lines
511 B
Go

package repo
import (
"github.com/dokku/dokku/plugins/common"
)
// CommandGc runs 'git gc --aggressive' against the application's repo
func CommandGc(appName string) error {
if err := common.VerifyAppName(appName); err != nil {
return err
}
return RepoGc(appName)
}
// CommandPurgeCache deletes the contents of the build cache stored in the repository
func CommandPurgeCache(appName string) error {
if err := common.VerifyAppName(appName); err != nil {
return err
}
return PurgeCache(appName)
}