forked from git-lfs/git-lfs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
When we lock or unlock multiple files, we compute the same data for each path, resulting in possibly calling multiple different commands. The repository on which we're working is not going to change while the command is running (and if it does get moved or removed, then dying is fine), so let's cache this data to try to avoid the expense of calling `git rev-parse` command multiple times. Make some changes here to use the existing values in the config object instead of calling the `git` package ourselves. That will compute both of these values once instead of recomputing them again and again, and also moves the error handling out of this codepath. In addition, move these calls up to the top of their respective functions so that we can cache these values before further calls, eliminating more useless `git rev-parse` invocations.
- Loading branch information
Showing
3 changed files
with
49 additions
and
27 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
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