optionally pass branch name
This commit is contained in:
parent
adef980837
commit
d7a90a71ab
11
autogen.go
11
autogen.go
|
@ -39,8 +39,15 @@ func (repo *Repo) AutogenSave(files []string, refname string, del bool) error {
|
|||
}
|
||||
|
||||
// restores files from git metadata (notes)
|
||||
func (repo *Repo) AutogenRestore() error {
|
||||
result := repo.Run([]string{"git", "notes", "show"})
|
||||
func (repo *Repo) AutogenRestore(refname string) error {
|
||||
var cmd []string
|
||||
if refname == "" {
|
||||
cmd = []string{"git", "notes", "show"}
|
||||
} else {
|
||||
cmd = []string{"git", "notes", "show", refname}
|
||||
}
|
||||
|
||||
result := repo.Run(cmd)
|
||||
if result.Exit != 0 {
|
||||
return errors.New(fmt.Sprint("git notes show returned ", result.Exit))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue