summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--autogen.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/autogen.go b/autogen.go
index b157d03..c216716 100644
--- a/autogen.go
+++ b/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))
}