Refactor error handling
This commit is contained in:
parent
44807299b1
commit
753021af5e
7 changed files with 108 additions and 80 deletions
12
repo.go
Normal file
12
repo.go
Normal file
|
@ -0,0 +1,12 @@
|
|||
package main
|
||||
|
||||
import "github.com/go-git/go-git/v5"
|
||||
|
||||
func openRepo(gitdir *string) (repo *git.Repository, tree *git.Worktree, err error) {
|
||||
repo, err = git.PlainOpen(*gitdir)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
tree, err = repo.Worktree()
|
||||
return
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue