From cc094858b3405574d56c72694ddded7628a7b973 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 15 Mar 2021 08:59:34 -0700 Subject: [PATCH] Fix tests on master - reset needs "--" arg Now that the worktree dirs are the same name as the hash, `git reset` doesn't know if we are asking for reset-to-hash or reset-the-dir. Adding "--" makes that unambiguous. Tests pass now. --- cmd/git-sync/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/git-sync/main.go b/cmd/git-sync/main.go index 434bf76..c0e51c8 100644 --- a/cmd/git-sync/main.go +++ b/cmd/git-sync/main.go @@ -725,7 +725,7 @@ func (git *repoSync) AddWorktreeAndSwap(ctx context.Context, hash string) error } // Reset the worktree's working copy to the specific rev. - _, err = runCommand(ctx, worktreePath, git.cmd, "reset", "--hard", hash) + _, err = runCommand(ctx, worktreePath, git.cmd, "reset", "--hard", hash, "--") if err != nil { return err } @@ -768,7 +768,7 @@ func (git *repoSync) AddWorktreeAndSwap(ctx context.Context, hash string) error } // Reset the root's rev (so we can prune and so we can rely on it later). - _, err = runCommand(ctx, git.root, git.cmd, "reset", "--hard", hash) + _, err = runCommand(ctx, git.root, git.cmd, "reset", "--hard", hash, "--") if err != nil { return err }