mirror of
https://github.com/Jguer/yay
synced 2024-07-21 10:16:10 +00:00
fix(download): use git pull --rebase --autostash instead of --ff-only. fixes #1635
This commit is contained in:
parent
bf288822b9
commit
81eeb8c495
|
@ -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{}
|
||||
|
|
|
@ -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{}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue