Skip to content

fix: dynamic git dir lookup instead of hardcoded dev path - #143

Open
afatihakpolat wants to merge 1 commit into
BusKill:devfrom
afatihakpolat:fix-111-git-path
Open

fix: dynamic git dir lookup instead of hardcoded dev path#143
afatihakpolat wants to merge 1 commit into
BusKill:devfrom
afatihakpolat:fix-111-git-path

Conversation

@afatihakpolat

Copy link
Copy Markdown

Closes #111

Bug

upgrade() used --git-dir=/home/user/sandbox/buskill-app/.git when SOURCE_DATE_EPOCH empty. Fails on any other machine with fatal: not a git repository, then int(b'') ValueError / hang (no timeout).

Fix

Dynamic .git discovery: BUSKILL_GIT_DIR override (dir or root) -> upward search from file (covers worktrees). List-form subprocess, timeout 10, returncode/stdout guard, try/except graceful continue. No shell=True, no new imports.

Tests

  • py_compile clean, git diff --check clean, no hardcoded path, no shell=True
  • Real repo lookup returns 1784494993 (matches git log)
  • Missing .git skips gracefully, bogus .git rc128 skipped, override root/.git both work

Files

  • src/packages/buskill/init.py (37+/8-)

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