commit d17e9b1c731999d3c67f2ed8227a60460977eefa
parent 1e86224373017d7603b236309c97660d12e87d8c
Author: Sean Enck <sean@ttypty.com>
Date: Wed, 14 Sep 2022 20:31:18 -0400
use a relative path to entry
Diffstat:
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/internal/store/filesystem.go b/internal/store/filesystem.go
@@ -131,10 +131,14 @@ func (s FileSystem) gitAction(action, entry string) error {
if !PathExists(filepath.Join(s.path, ".git")) {
return nil
}
- if err := s.gitRun(action, entry); err != nil {
+ useEntry, err := filepath.Rel(s.path, entry)
+ if err != nil {
+ return err
+ }
+ if err := s.gitRun(action, useEntry); err != nil {
return err
}
- return s.gitRun("commit", "-m", fmt.Sprintf("lb %s: %s", action, entry))
+ return s.gitRun("commit", "-m", fmt.Sprintf("lb %s: %s", action, useEntry))
}
func (s FileSystem) gitRun(args ...string) error {