Skip to content

fix(apps): refuse to reinstall an app from a different branch - #381

Open
mihir-kandoi wants to merge 2 commits into
developfrom
fix/reject-branch-mismatch-on-reinstall
Open

fix(apps): refuse to reinstall an app from a different branch#381
mihir-kandoi wants to merge 2 commits into
developfrom
fix/reject-branch-mismatch-on-reinstall

Conversation

@mihir-kandoi

Copy link
Copy Markdown
Contributor

App.install short-circuits when the app already exists in the bench — and silently discarded an explicitly requested branch while doing so. Importing erpnext@version-16-hotfix over an existing version-16 clone reported success while the site got version-16. Since a bench holds one checkout per app, the install now fails loudly naming both branches instead of pretending.

Also removes GetAppCommand's or "main" branch default: clone() already resolves the remote's real default branch, and the injected "main" would look like explicit intent to the new guard.

Related: SwitchBranchTask exists and is the right tool for moving an installed app to another branch, but nothing wires it to the CLI or admin API yet — follow-up. Independent of #377/#378/#380.

App.install short-circuits when the app is already in the bench, which
silently discarded an explicitly requested branch: importing
erpnext@version-16-hotfix over the existing version-16 clone reported
success while the site got version-16. A bench holds one checkout per
app, so the install now fails loudly, naming both branches.

GetAppCommand also stops defaulting an unspecified branch to 'main'.
clone() already resolves the remote's real default, and the injected
'main' would read as explicit intent to the new guard.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant