github.com/gitbundle/modules@v0.0.0-20231025071548-85b91c5c3b01/git/repo_hook.go (about) 1 // Copyright 2023 The GitBundle Inc. All rights reserved. 2 // Copyright 2017 The Gitea Authors. All rights reserved. 3 // Use of this source code is governed by a MIT-style 4 // license that can be found in the LICENSE file. 5 6 // Copyright 2015 The Gogs Authors. All rights reserved. 7 // Use of this source code is governed by a MIT-style 8 // license that can be found in the LICENSE file. 9 10 package git 11 12 // GetHook get one hook according the name on a repository 13 func (repo *Repository) GetHook(name string) (*Hook, error) { 14 return GetHook(repo.Path, name) 15 } 16 17 // Hooks get all the hooks on the repository 18 func (repo *Repository) Hooks() ([]*Hook, error) { 19 return ListHooks(repo.Path) 20 }