diff --git a/pkg/download/abs_test.go b/pkg/download/abs_test.go index 24b66de7..7ba48704 100644 --- a/pkg/download/abs_test.go +++ b/pkg/download/abs_test.go @@ -234,13 +234,13 @@ func TestABSPKGBUILDRepoExistsPerms(t *testing.T) { os.MkdirAll(filepath.Join(dir, "linux", ".git"), 0o777) - want := fmt.Sprintf("/usr/local/bin/git --no-replace-objects -C %s/linux pull --ff-only", dir) + want := fmt.Sprintf("/usr/local/bin/git --no-replace-objects -C %s/linux pull --rebase --autostash", dir) if os.Getuid() == 0 { ld := "systemd-run" if path, _ := exec.LookPath(ld); path != "" { ld = path } - want = fmt.Sprintf("%s --service-type=oneshot --pipe --wait --pty -p DynamicUser=yes -p CacheDirectory=yay -E HOME=/tmp --no-replace-objects -C %s/linux pull --ff-only", ld, dir) + want = fmt.Sprintf("%s --service-type=oneshot --pipe --wait --pty -p DynamicUser=yes -p CacheDirectory=yay -E HOME=/tmp --no-replace-objects -C %s/linux pull --rebase --autostash", ld, dir) } cmdRunner := &testRunner{} diff --git a/pkg/download/aur_test.go b/pkg/download/aur_test.go index d2e294c1..2bc42eee 100644 --- a/pkg/download/aur_test.go +++ b/pkg/download/aur_test.go @@ -113,13 +113,13 @@ func TestAURPKGBUILDRepoExistsPerms(t *testing.T) { os.MkdirAll(filepath.Join(dir, "yay-bin", ".git"), 0o777) - want := fmt.Sprintf("/usr/local/bin/git --no-replace-objects -C %s/yay-bin pull --ff-only", dir) + want := fmt.Sprintf("/usr/local/bin/git --no-replace-objects -C %s/yay-bin pull --rebase --autostash", dir) if os.Getuid() == 0 { ld := "systemd-run" if path, _ := exec.LookPath(ld); path != "" { ld = path } - want = fmt.Sprintf("%s --service-type=oneshot --pipe --wait --pty -p DynamicUser=yes -p CacheDirectory=yay -E HOME=/tmp --no-replace-objects -C %s/yay-bin pull --ff-only", ld, dir) + want = fmt.Sprintf("%s --service-type=oneshot --pipe --wait --pty -p DynamicUser=yes -p CacheDirectory=yay -E HOME=/tmp --no-replace-objects -C %s/yay-bin pull --rebase --autostash", ld, dir) } cmdRunner := &testRunner{} diff --git a/pkg/download/unified.go b/pkg/download/unified.go index 846e5297..d1c26901 100644 --- a/pkg/download/unified.go +++ b/pkg/download/unified.go @@ -56,7 +56,7 @@ func downloadGitRepo(ctx context.Context, cmdBuilder exe.GitCmdBuilder, errOut: gotext.Get("error reading %s", filepath.Join(dest, pkgName, ".git")), } default: - cmd := cmdBuilder.BuildGitCmd(ctx, filepath.Join(dest, pkgName), "pull", "--ff-only") + cmd := cmdBuilder.BuildGitCmd(ctx, filepath.Join(dest, pkgName), "pull", "--rebase", "--autostash") _, stderr, errCmd := cmdBuilder.Capture(cmd) if errCmd != nil {