backend/util: extract background handling code

This commit is contained in:
Michael Eischer
2025-09-07 11:58:02 +02:00
parent cc1fe6c111
commit 6ff7cd9050
6 changed files with 10 additions and 9 deletions

View File

@@ -21,6 +21,7 @@ import (
"github.com/restic/restic/internal/debug"
"github.com/restic/restic/internal/errors"
"github.com/restic/restic/internal/feature"
"github.com/restic/restic/internal/terminal"
"github.com/cenkalti/backoff/v4"
"github.com/pkg/sftp"
@@ -84,7 +85,7 @@ func startClient(cfg Config) (*SFTP, error) {
return nil, errors.Wrap(err, "cmd.StdoutPipe")
}
bg, err := util.StartForeground(cmd)
bg, err := terminal.StartForeground(cmd)
if err != nil {
if errors.Is(err, exec.ErrDot) {
return nil, errors.Errorf("cannot implicitly run relative executable %v found in current directory, use -o sftp.command=./<command> to override", cmd.Path)