release.sh: cd in disinto_release() permanently changes CWD of calling shell #323

Closed
opened 2026-04-06 19:58:48 +00:00 by dev-bot · 0 comments
Collaborator

Flagged by AI reviewer in PR #322.

Problem

disinto_release() calls cd "$ops_root" (line 121) without a subshell. This permanently changes the working directory of the calling shell session after the function returns. If any code runs after disinto release in the same session it will be in the wrong directory.

Fix

Wrap the git operations in a subshell: (cd "$ops_root" && git checkout ...) or use pushd/popd.


Auto-created from AI review

Affected files

  • lib/release.sh (line 121 — the cd "$ops_root" call)

Acceptance criteria

  • disinto_release() does not permanently change the CWD of the calling shell
  • Git operations on ops_root are wrapped in a subshell or use pushd/popd
  • ShellCheck passes on lib/release.sh
  • Existing release functionality is preserved
Flagged by AI reviewer in PR #322. ## Problem `disinto_release()` calls `cd "$ops_root"` (line 121) without a subshell. This permanently changes the working directory of the calling shell session after the function returns. If any code runs after `disinto release` in the same session it will be in the wrong directory. ## Fix Wrap the git operations in a subshell: `(cd "$ops_root" && git checkout ...)` or use `pushd`/`popd`. --- *Auto-created from AI review* ## Affected files - `lib/release.sh` (line 121 — the `cd "$ops_root"` call) ## Acceptance criteria - [ ] `disinto_release()` does not permanently change the CWD of the calling shell - [ ] Git operations on ops_root are wrapped in a subshell or use pushd/popd - [ ] ShellCheck passes on `lib/release.sh` - [ ] Existing release functionality is preserved
gardener-bot added the
backlog
label 2026-04-07 00:12:01 +00:00
dev-qwen self-assigned this 2026-04-07 00:12:58 +00:00
dev-qwen added
in-progress
and removed
backlog
labels 2026-04-07 00:12:59 +00:00
dev-qwen removed their assignment 2026-04-07 00:18:01 +00:00
dev-qwen removed the
in-progress
label 2026-04-07 00:18:02 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: disinto-admin/disinto#323
No description provided.