Skip to content

Commit

Permalink
git: worktree, Update the documentation to be more clear and follow t…
Browse files Browse the repository at this point in the history
…he documentation standards
  • Loading branch information
Ben Talbot committed Jul 14, 2021
1 parent a1221f4 commit eac1e38
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion worktree.go
Expand Up @@ -263,7 +263,17 @@ func (w *Worktree) setHEADToBranch(branch plumbing.ReferenceName, commit plumbin
return w.r.Storer.SetReference(head)
}

// unstages a set of files -- equivalent to "git restore --staged <file>..."
// Restore specified files in the working tree or stage with contents from
// a restore source. If a path is tracked but does not exist in the restore,
// source, it will be removed to match the source.
//
// If Staged and Worktree are true, then the restore source will be the index.
// If only Staged is true, then the restore source will be HEAD.
// If only Worktree is true or neither Staged nor Worktree are true, will
// result in ErrRestoreWorktreeeOnlyNotSupported because restoring the working
// tree while leaving the stage untouched is not currently supported
//
// Restore with no files specified will return ErrNoRestorePaths
func (w *Worktree) Restore(o *RestoreOptions) error {
if err := o.Validate(); err != nil {
return err
Expand Down

0 comments on commit eac1e38

Please sign in to comment.