Skip to content

Commit

Permalink
remove changes
Browse files Browse the repository at this point in the history
Signed-off-by: Paulo Gomes <[email protected]>
  • Loading branch information
pjbgf committed Oct 10, 2024
1 parent 5d32357 commit a988a63
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions worktree.go
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ func (w *Worktree) checkoutChangeRegularFile(name string,
return err
}

return w.addIndexFromFile(name, e.Hash, f.Mode, idx)
return w.addIndexFromFile(name, e.Hash, idx)
}

return nil
Expand Down Expand Up @@ -797,13 +797,18 @@ func (w *Worktree) addIndexFromTreeEntry(name string, f *object.TreeEntry, idx *
return nil
}

func (w *Worktree) addIndexFromFile(name string, h plumbing.Hash, mode filemode.FileMode, idx *indexBuilder) error {
func (w *Worktree) addIndexFromFile(name string, h plumbing.Hash, idx *indexBuilder) error {
idx.Remove(name)
fi, err := w.Filesystem.Lstat(name)
if err != nil {
return err
}

mode, err := filemode.NewFromOSFileMode(fi.Mode())
if err != nil {
return err
}

e := &index.Entry{
Hash: h,
Name: name,
Expand Down

0 comments on commit a988a63

Please sign in to comment.