Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools: close channel if we fail during walking
If the user runs git lfs track (or almost any command), we'll try to clean up any temporary files that may be left around. When doing so, we walk the temporary directory, looking for any files. Normally, this works great, but when the user is in a repository that is owned by another user, the temporary directory may not have been created and in such a case, our walk may fail. If so, that's fine, but when we return an error, we need to be sure to clean up the WaitGroup and close the channel. If we don't, the tools.fastWalkCallback routine will hang waiting for the channel and we won't make any more progress, so the program will just hang. Let's defer the Wait call so we always clean up on the way out.
- Loading branch information