(c *C)
| 3412 | } |
| 3413 | |
| 3414 | func (s *WorktreeSuite) TestRestoreBoth(c *C) { |
| 3415 | _, w, names := setupForRestore(c, s) |
| 3416 | |
| 3417 | // Attempt without files should throw an error like the git restore --staged --worktree |
| 3418 | opts := RestoreOptions{Staged: true, Worktree: true} |
| 3419 | err := w.Restore(&opts) |
| 3420 | c.Assert(err, Equals, ErrNoRestorePaths) |
| 3421 | |
| 3422 | // Restore Staged files in 2 groups and confirm status |
| 3423 | opts.Files = []string{names[0], names[1]} |
| 3424 | err = w.Restore(&opts) |
| 3425 | c.Assert(err, IsNil) |
| 3426 | verifyStatus(c, "Restored First", w, names, []FileStatus{ |
| 3427 | {Worktree: Untracked, Staging: Untracked}, |
| 3428 | {Worktree: Untracked, Staging: Untracked}, |
| 3429 | {Worktree: Modified, Staging: Modified}, |
| 3430 | {Worktree: Unmodified, Staging: Deleted}, |
| 3431 | }) |
| 3432 | |
| 3433 | opts.Files = []string{names[2], names[3]} |
| 3434 | err = w.Restore(&opts) |
| 3435 | c.Assert(err, IsNil) |
| 3436 | verifyStatus(c, "Restored Second", w, names, []FileStatus{ |
| 3437 | {Worktree: Untracked, Staging: Untracked}, |
| 3438 | {Worktree: Untracked, Staging: Untracked}, |
| 3439 | {Worktree: Untracked, Staging: Untracked}, |
| 3440 | {Worktree: Untracked, Staging: Untracked}, |
| 3441 | }) |
| 3442 | } |
| 3443 | |
| 3444 | func TestFilePermissions(t *testing.T) { |
| 3445 | // Initialize an in memory repository |
nothing calls this directly
no test coverage detected