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 }