mirror of
https://github.com/nushell/nushell.git
synced 2026-11-26 03:25:39 +08:00
## Description `gstat` gave wrong answers in several situations, all from the plugin's own code rather than from libgit2. I compared it with `git status` on fixture repos (built with git 2.56) and confirmed each case on the 0.116 plugin. ## User-facing changes (Release notes) - `gstat` no longer wraps its counts above 65,535. A repository with 70,000 untracked files used to report 4,464. - When `gstat` can't read a repository's status (a split or sparse index, a damaged index, or a bare repository), the status counts (`idx_*`, `wt_*`, `ignored`, `conflicts`) are now -1 instead of 0, so the repository no longer looks clean. The other fields are still filled. - `gstat` now fills `ignored` (an ignored directory counts once) and `wt_renamed`. A file renamed without `git mv` now counts as one `wt_renamed` instead of one `wt_deleted` plus one `wt_untracked`, and also as `wt_modified` if it was edited after the move. - In a repository with no commits yet, `branch` shows the branch `HEAD` points to instead of `master` or `HEAD`. - `repo_name` is now the name of the working directory in linked worktrees and submodules (it used to be `worktrees` or `modules`) and the repository's own directory name for bare repositories. - The gstat plugin starts faster on systems where it used to link a system libgit2, such as a `cargo install` on macOS with Homebrew's libgit2. ## Additional notes Replacing git2 with gitoxide (`gix`) would make each call about 2x faster, but it adds 60 crates. I measured it separately and left it out of this PR.