fix: handle detached HEAD state in bench update#1685
Open
RendaniSinyage wants to merge 4 commits intofrappe:developfrom
Open
fix: handle detached HEAD state in bench update#1685RendaniSinyage wants to merge 4 commits intofrappe:developfrom
RendaniSinyage wants to merge 4 commits intofrappe:developfrom
Conversation
Currently, bench update crashes if an app is pinned to a specific tag/version (Detached HEAD) because git symbolic-ref fails. This fix catches that error and skips the update for those specific apps.
fix: handle detached HEAD state in bench update
Member
I don't see this part implemented in your PR. Currently there seems to be a few usages of this method which don't handle the |
Member
|
Do tag me whenever you implement the changes. |
Member
|
You've changed the formatting of the entire file - could you revert that? Also the comment added can be removed. |
Author
|
@akhilnarang fixed |
9f9057b to
49bd455
Compare
49bd455 to
2c7e6bf
Compare
|
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.



Currently,
bench updatecrashes if an app is pinned to a specific tag/version (Detached HEAD) becausegit symbolic-reffails. This fix catches that error and skips the update for those specific apps.What type of a PR is this?
This PR fixes a crash in
bench updatewhen an app is checked out to a specific tag or commit hash (Detached HEAD state).The Problem:
When an app is pinned (e.g.,
v1.0.0), it has no active branch. The commandgit symbolic-ref -q --short HEADfails with exit code 1, causing the entire bench update process to crash.The Fix:
get_current_branchinbench/utils/app.pyto catch the exception and returnNoneif no branch is found (Detached HEAD).pull_appsinbench/app.pyto check forNone. If detected, it logs a message and skips thegit pullfor that specific app, allowing the rest of the update to proceed.N/A - CLI fix.