fix: bridge git-export preserves executable bits via shebang detection (issue #38)
GitExporter.fix_file_modes unconditionally chmod'd every file to 0o644, stripping the executable bit from shell scripts, Node CLI scripts, and any other executable. The help text always advertised 755-for-executables, but the implementation had no concept of executability.
Fix: replace the unconditional 0o644 with shebang-driven heuristic. Files whose first two bytes are '#!' get 0o755; everything else gets 0o644. Add GitExporter._has_shebang(path) static helper — reads 2 bytes, returns False on any OSError (fail-safe), never sets setuid/setgid.
Also change --fix-modes default from False to True (with BooleanOptionalAction so --no-fix-modes opts out), matching the documented behaviour new users expect.
Verified: 613-file bridge of aaronrene/knowtation produces 41 x 100755 and 572 x 100644 — zero false positives, zero false negatives.
Fixes: https://staging.musehub.ai/gabriel/musehub/issues/38
0 comments
muse hub commit comment sha256:d69b772f61297a31fe72352c58eb95315f6ec4f60f8a82435f55660f1f7b6e76 --body "your comment"
No comments yet. Be the first to start the discussion.