|

feat: hook detects bare git repos to allow testdata fixtures

Author: Chris Tusa <chris.tusa@leafscale.com>
Date: May 03, 2026 15:24
Changeset: 69157bd15c5796ceec52b0d80661a942ae6cb861
Branch: default

Changed files:

Diff

diff -r 3fdeca5caf86 -r 69157bd15c57 hooks/block-git-in-hg.sh
--- a/hooks/block-git-in-hg.sh	Sun May 03 15:23:11 2026 -0500
+++ b/hooks/block-git-in-hg.sh	Sun May 03 15:24:50 2026 -0500
@@ -41,6 +41,12 @@
     exit 0
 fi
 
+# Bare git repo check: cwd contains HEAD + refs/ + objects/ at the top level
+# (the directory itself IS the git metadata; there's no .git subdir).
+if [[ -e "$cwd/HEAD" && -d "$cwd/refs" && -d "$cwd/objects" ]]; then
+    exit 0
+fi
+
 dir=$cwd
 hg_root=""
 git_root=""