fix(git): support repo cache with getBranchUpdateDate#42852
Open
jamietanna wants to merge 1 commit intomainfrom
Open
fix(git): support repo cache with getBranchUpdateDate#42852jamietanna wants to merge 1 commit intomainfrom
getBranchUpdateDate#42852jamietanna wants to merge 1 commit intomainfrom
Conversation
As noted in #41953, the introduction of `getBranchUpdateDate` did not take into account the use of a repository cache. When using a repository cache, the repo is not cloned until it is needed (and various metadata is used from the cache instead). However, when using a cache (with a repo not yet cloned) this results in `getBranchUpdateDate` failing (and a debug log appearing). We can instead handle this by performing a repo sync at this point. Co-authored-by: Claude Sonnet 4.6 <jamie.tanna+claude-code@mend.io>
jamietanna
commented
Apr 23, 2026
| if (!branchSha) { | ||
| return null; | ||
| } | ||
| await syncGit(); |
Contributor
Author
There was a problem hiding this comment.
I'm not sure if this is the right call here - I wonder if we should instead try and get this from the cache?
Member
There was a problem hiding this comment.
yes, I think we should have this in cache 🤔
caching can be done in a follow up PR
Contributor
There was a problem hiding this comment.
Thanks a lot for the quick patch, @jamietanna.
caching can be done in a follow up PR
And please let me know if you'd like help with that. 😊
viceice
approved these changes
Apr 23, 2026
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.
Changes
As noted in #41953, the introduction of
getBranchUpdateDatedid nottake into account the use of a repository cache.
When using a repository cache, the repo is not cloned until it is needed
(and various metadata is used from the cache instead).
However, when using a cache (with a repo not yet cloned) this results in
getBranchUpdateDatefailing (and a debug log appearing).We can instead handle this by performing a repo sync at this point.
Context
Please select one of the following:
AI assistance disclosure
Did you use AI tools to create any part of this pull request?
Please select one option and, if yes, briefly describe how AI was used (e.g., code, tests, docs) and which tool(s) you used.
Documentation (please check one with an [x])
How I've tested my work (please select one)
I have verified these changes via:
The public repository: