8000 Update worktree_status.go · go-git/go-git@d9682c5 · GitHub
[go: up one dir, main page]

Skip to content

Commit d9682c5

Browse files
nicholasSUSEpjbgf
andauthored
Update worktree_status.go
Co-authored-by: Paulo Gomes <paulo.gomes.uk@gmail.com>
1 parent 09f4409 commit d9682c5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

worktree_status.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,8 +543,10 @@ func (w *Worktree) doUpdateFileToIndex(e *index.Entry, filename string, h plumbi
543543
return err
544544
}
545545

546-
// The size of a symlink is the length of the path to the target
547-
// The size of Regular and Executable files is the size of the files
546+
// The entry size must always reflect the current state, otherwise
547+
// it will cause go-git's Worktree.Status() to divert from "git status".
548+
// The size of a symlink is the length of the path to the target.
549+
// The size of Regular and Executable files is the size of the files.
548550
e.Size = uint32(info.Size())
549551

550552
fillSystemInfo(e, info.Sys())

0 commit comments

Comments
 (0)
0