From 08282bf901d828863013c431b00b8a35259d6029 Mon Sep 17 00:00:00 2001 From: Dominik Schulz Date: Tue, 5 Jun 2018 13:14:20 +0200 Subject: [PATCH] Fix unwanted autosync on recipients save Fixes #793 --- pkg/store/sub/move.go | 1 + pkg/store/sub/recipients.go | 5 +++++ pkg/store/sub/write.go | 1 + 3 files changed, 7 insertions(+) diff --git a/pkg/store/sub/move.go b/pkg/store/sub/move.go index 8c44c2a75f..4dcb9fe408 100644 --- a/pkg/store/sub/move.go +++ b/pkg/store/sub/move.go @@ -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 } diff --git a/pkg/store/sub/recipients.go b/pkg/store/sub/recipients.go index 50ed93a268..d50346d058 100644 --- a/pkg/store/sub/recipients.go +++ b/pkg/store/sub/recipients.go @@ -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 { diff --git a/pkg/store/sub/write.go b/pkg/store/sub/write.go index a26826b98f..e598c0af87 100644 --- a/pkg/store/sub/write.go +++ b/pkg/store/sub/write.go @@ -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 }