Repository navigation
fix multiple git update-index invocations - #2531
Merged
Merged
Conversation
The gitIndexer starts a new `git update-index` process when the first file is given to it. A reference to this process is stored in the `cmd` variable of the gitIndexer struct. This variable was always `nil` after the refactoring in ae4d261 ("move `git update-index` invocation to git package", 2017-08-02). Consequently, a new `git update-index` process was invoked for every file. Fix this by refactoring the `git update-index` invocation, again. This time we return the subprocess pointer. This is necessary because we want to call `Wait()` on the process when the gitIndexer is closed.
ttaylorr
approved these changes
Aug 26, 2017
ttaylorr
left a comment
Contributor
There was a problem hiding this comment.
This change looks great -- and great detective work tracking this down.
I think adding something to the integration tests to measure how many Git processes an individual test spawns and abandons would be interesting future work.
For now, this looks great. I've scheduled it for the next release.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The gitIndexer starts a new
git update-indexprocess when the firstfile is given to it. A reference to this process is stored in the
cmdvariable of the gitIndexer struct. This variable was always
nilafterthe refactoring in ae4d261 ("move
git update-indexinvocation to gitpackage", 2017-08-02). Consequently, a new
git update-indexprocesswas invoked for every file.
Fix this by refactoring the
git update-indexinvocation, again. Thistime we return the subprocess pointer. This is necessary because we
want to call
Wait()on the process when the gitIndexer is closed.I noticed the bug in #2439 and realized that I introduced it with my recent refactoring. Sorry!
Has anyone a good idea how to check the number of invoked
git update-indexprocesses in a test case?