Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#1911·go-git

Change.PatchContext: User-provided ctx timeout is not applied in filePatchWithContext, falls back to 1-hour diff execution

Author: bitpengCreated Mar 19, 2026Updated Sep 15, 2026
Labelsbugstale

Bug Description

There is a hidden bug in the Change.PatchContext method: even when users call this function with a ctx that has a timeout of only a few seconds, filePatchWithContext always uses diff.Do(fromContent, toContent) — which has a one-hour execution timeout. This is extremely confusing for users. I've opened a pull request to fix this: 1910

go-git Version

5.16.2

Steps to Reproduce

No response

Additional Information

No response

Source: go-git/go-git

View original on GitHubView discussion on GitHub