MCPcopy Index your code
hub / github.com/go-git/go-git / TestRestoreWorktree

Method TestRestoreWorktree

worktree_test.go:3401–3412  ·  view source on GitHub ↗
(c *C)

Source from the content-addressed store, hash-verified

3399}
3400
3401func (s *WorktreeSuite) TestRestoreWorktree(c *C) {
3402 _, w, names := setupForRestore(c, s)
3403
3404 // Attempt without files should throw an error like the git restore
3405 opts := RestoreOptions{}
3406 err := w.Restore(&opts)
3407 c.Assert(err, Equals, ErrNoRestorePaths)
3408
3409 opts.Files = []string{names[0], names[1]}
3410 err = w.Restore(&opts)
3411 c.Assert(err, Equals, ErrRestoreWorktreeOnlyNotSupported)
3412}
3413
3414func (s *WorktreeSuite) TestRestoreBoth(c *C) {
3415 _, w, names := setupForRestore(c, s)

Callers

nothing calls this directly

Calls 2

setupForRestoreFunction · 0.85
RestoreMethod · 0.80

Tested by

no test coverage detected