mirror of
https://github.com/dokku/dokku.git
synced 2025-12-16 20:17:44 +01:00
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
24 lines
511 B
Go
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)
|
|
}
|