Skip to content

fix(install): gate update on .git checkout and self-heal non-git dir - #100

Merged
f3rdy merged 1 commit into
masterfrom
fix/issue-98-install-git-gate
Jul 17, 2026
Merged

f3rdy merged 1 commit into
masterfrom
fix/issue-98-install-git-gate

Conversation

@f3rdy

@f3rdy f3rdy commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

budjira update failed with fatal: not a git repository (or any of the parent directories): .git.

install.sh gated its update path on directory existence
([ -d "$INSTALL_DIR" ]), not on the directory being a git checkout. When
~/.local/share/budjira existed but had no .git (interrupted or corrupted
earlier install), the update branch ran git fetch in a non-repo and aborted.

Fix

  • Gate on $INSTALL_DIR/.git instead of $INSTALL_DIR.
  • Self-heal: if a non-git directory exists, remove it and re-clone.
  • Valid-checkout update path and fresh-clone path are unchanged.

Verification

Branch-selection tested with a stubbed git for all three states:

State Branch taken Result
non-git dir exists (the bug) heal → rm -rf + clone no crash, .git present
valid git checkout update (fetch/reset/clean) unchanged
nothing exists fresh clone .git present

sh -n install.sh clean.

No release needed

install.sh is fetched live from master at update time (hardcoded URL in
budjira/utils/version.py:174) and is not part of the installed package. The fix
takes effect for every budjira update as soon as it lands on master — no
version bump.

Workaround until merged

rm -rf ~/.local/share/budjira
curl -LsSf https://raw.githubusercontent.com/cdds-ab/budjira/master/install.sh | sh

Closes #98
Related: #99 (update ignores install method — separate, broader issue)

install.sh gated its update path on directory existence
(`[ -d "$INSTALL_DIR" ]`) rather than on the directory being a git
checkout. When ~/.local/share/budjira existed but had no .git (an
interrupted or corrupted earlier install), the update branch ran
`git fetch` in a non-repo and aborted with "not a git repository",
so `budjira update` failed.

Gate on `$INSTALL_DIR/.git` instead, and heal a non-git directory by
removing it and re-cloning. The valid-checkout update path and the
fresh-clone path are unchanged.

Closes #98
@f3rdy
f3rdy merged commit cf696fc into master Jul 17, 2026
5 checks passed
@f3rdy
f3rdy deleted the fix/issue-98-install-git-gate branch July 29, 2026 07:37
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.

bug(update): install.sh update path crashes when ~/.local/share/budjira is not a git checkout

1 participant