From cac832eea0d08793508924388ba7004f6d2c1619 Mon Sep 17 00:00:00 2001 From: Leo Huang Date: Fri, 20 May 2016 16:37:50 +1000 Subject: [PATCH] Fix adding notes to use absolute path Relative path is ambiguously relative to current directory or git root --- store/git.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/store/git.go b/store/git.go index 9f08e23..d23b2a0 100644 --- a/store/git.go +++ b/store/git.go @@ -7,6 +7,7 @@ import ( "os" "os/exec" "strings" + "path/filepath" ) func GitLog(ref string, commitrange string, format string) *exec.Cmd { @@ -48,7 +49,7 @@ func WriteNotes(writef func(io.Writer) error, ref string) error { return fmt.Errorf("Error closing .git-ratchet-note %s", err) } - writenotes := exec.Command("git", "notes", "--ref="+ref, "add", "-f", "-F", notepath) + writenotes := exec.Command("git", "notes", "--ref="+ref, "add", "-f", "-F", filepath.Abs(notepath)) log.INFO.Println(strings.Join(writenotes.Args, " "))