git-lfs/commands/command_update.go

31 lines
583 B
Go
Raw Normal View History

package commands
import (
2015-03-19 19:30:55 +00:00
"github.com/github/git-lfs/lfs"
"github.com/spf13/cobra"
)
var (
updateCmd = &cobra.Command{
Use: "update",
2015-03-19 19:30:55 +00:00
Short: "Update local Git LFS configuration",
Run: updateCommand,
}
)
2015-03-19 19:30:55 +00:00
// updateCommand is used for updating parts of Git LFS that reside under
// .git/lfs.
func updateCommand(cmd *cobra.Command, args []string) {
updatePrePushHook()
}
2014-09-24 17:10:29 +00:00
// updatePrePushHook will force an update of the pre-push hook.
func updatePrePushHook() {
2015-03-19 19:30:55 +00:00
lfs.InstallHooks(true)
Print("Updated pre-push hook")
}
func init() {
RootCmd.AddCommand(updateCmd)
}