Skip to content

Commit

Permalink
Fix unwanted autosync on recipients save (gopasspw#848)
Browse files Browse the repository at this point in the history
  • Loading branch information
dominikschulz authored Jun 5, 2018
1 parent d0b90c7 commit 265a168
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/store/sub/move.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func (s *Store) delete(ctx context.Context, name string, recurse bool) error {
return errors.Wrapf(err, "failed to commit changes to git")
}

// abort if auto sync is not set
if !IsAutoSync(ctx) {
return nil
}
Expand Down
5 changes: 5 additions & 0 deletions pkg/store/sub/recipients.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ func (s *Store) saveRecipients(ctx context.Context, rs []string, msg string, exp
}
}

// return if autosync is not enabled
if !IsAutoSync(ctx) {
return nil
}

// push to remote repo
if err := s.rcs.Push(ctx, "", ""); err != nil {
if errors.Cause(err) == store.ErrGitNotInit {
Expand Down
1 change: 1 addition & 0 deletions pkg/store/sub/write.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (s *Store) gitCommitAndPush(ctx context.Context, name string) error {
return errors.Wrapf(err, "failed to commit changes to git")
}

// abort if autosync is not set
if !IsAutoSync(ctx) {
return nil
}
Expand Down

0 comments on commit 265a168

Please sign in to comment.