Skip to content

fix: handle detached HEAD state in bench update & add --app-name override for get-app#1708

Open
RendaniSinyage wants to merge 4 commits intofrappe:developfrom
Frappenize:fix-handle-detached-HEAD-state-in-bench
Open

fix: handle detached HEAD state in bench update & add --app-name override for get-app#1708
RendaniSinyage wants to merge 4 commits intofrappe:developfrom
Frappenize:fix-handle-detached-HEAD-state-in-bench

Conversation

@RendaniSinyage
Copy link
Copy Markdown

What type of a PR is this?

  • Changes to Existing Features
  • New Feature Submissions
  • Bug Fix

Please provide enough information so that others can review your pull request:

This PR combines two changes:

1. Bug Fix — Detached HEAD crash in bench update

When an app is pinned to a tag or commit, git symbolic-ref -q --short HEAD fails with exit code 1, crashing bench update entirely.

  • bench/utils/app.pyget_current_branch wraps the git command in a try/except; returns None if in Detached HEAD state (e.g. pinned tag)
  • bench/app.pypull_apps checks if not branch; prints a skip message and calls continue, allowing the rest of the update to proceed

2. Enhancement — --app-name override for bench get-app

Allows renaming the cloned app folder on disk at install time (e.g. cloning rpaas as paas).

  • bench/commands/make.py — adds --app-name click option with default=None
  • bench/app.py — after cloning, if app_name is provided and differs from app.repo, renames the folder using os.rename and updates both app.app_name and app.repo

Screenshots/GIFs

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you lint your code locally prior to submission?
  • Have you successfully run tests with your changes locally?
  • Does your commit message have an explanation for your changes and why you'd like us to include them?
  • Docs have been added / updated
  • Tests for the changes have been added (for bug fixes / features)
  • Did you modify the existing test cases? If yes, why?

Screenshots/GIFs

N/A - CLI fix.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 4, 2026

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