Skip to content

Commit

Permalink
windows: improve changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fcharlie committed Nov 25, 2024
1 parent b568352 commit 38135e2
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions pkg/zeta/worktree_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ type hasher interface {
}

func (w *Worktree) hijackChangeFileMode(ch *merkletrie.Change) bool {
if ch.From == nil || ch.To == nil {
return false
}
from := ch.From.Last()
to := ch.To.Last()
a, ok := from.(hasher)
Expand Down Expand Up @@ -114,9 +111,6 @@ func (w *Worktree) excludeIgnoredChanges(changes merkletrie.Changes) merkletrie.
}
}
}
if w.hijackChangeFileMode(&ch) {
continue
}
// Add
if ch.From == nil {
newItems = append(newItems, ch)
Expand All @@ -127,6 +121,10 @@ func (w *Worktree) excludeIgnoredChanges(changes merkletrie.Changes) merkletrie.
rmItems[strings.ToLower(ch.From.String())] = ch
continue
}
// modified
if w.hijackChangeFileMode(&ch) {
continue
}
res = append(res, ch)
}
for _, ch := range newItems {
Expand Down

0 comments on commit 38135e2

Please sign in to comment.