Prevent dangling GetAttribute calls (#18754)

It appears possible that there could be a hang due to unread data from the
repo-attribute command pipes. This PR simply closes these during the defer.

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath authored and GitHub committed 2022-02-14 18:03:56 +01:00
1 parent 5348e198db
commit 4482f62a26
3 files changed
+13 -7

No files matched your search

+1
View File
@@ -1422,6 +1422,7 @@ func GetDiff(gitRepo *git.Repository, opts *DiffOptions, files ...string) (*Diff
}()
}
defer func() {
_ = checker.Close()
cancel()
}()
}