-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only use temp index if hunks are staged
For big repos reading HEAD's tree into the temp index can apparently take a while, so we should skip creating it if we can. Also, if we use a temp index for unstaged hunks, then the original index will be out-of-sync with any hunks that were committed via the temp index. If you hit this, `git restore --staged` or `git read-tree HEAD^{tree}` can be used to read the new HEAD's tree into the index. In tests, if no staged changes are explicitly expected via the `staged_want` param, fail if anything is in the index after calling main(). Fixes #16
- Loading branch information
Showing
2 changed files
with
27 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters