From 50a94c682ccd5d2ab4cf2cfe954a10132077e608 Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Wed, 7 Feb 2024 01:16:27 +0300 Subject: [PATCH] Feat(unabsorbgitdirs): Add a sentinel Check "gitdir:". --- submodules/unabsorbgitdirs | 4 ++++ submodules/unabsorbgitdirs-recursive | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/submodules/unabsorbgitdirs b/submodules/unabsorbgitdirs index 8625040..76d1c40 100755 --- a/submodules/unabsorbgitdirs +++ b/submodules/unabsorbgitdirs @@ -18,6 +18,10 @@ fi git config --unset core.worktree read _gitdir gitpath < .git +if [ "$_gitdir" != gitdir: ]; then + echo "Error: Bad gitlink, aborting" >&2 + exit 1 +fi unset _gitdir rm .git exec mv "$gitpath" .git diff --git a/submodules/unabsorbgitdirs-recursive b/submodules/unabsorbgitdirs-recursive index b6ff9cc..f7427fc 100755 --- a/submodules/unabsorbgitdirs-recursive +++ b/submodules/unabsorbgitdirs-recursive @@ -33,6 +33,10 @@ fi git config --unset core.worktree read _gitdir gitpath < .git +if [ "$_gitdir" != gitdir: ]; then + echo "Error: Bad gitlink, aborting" >&2 + exit 1 +fi unset _gitdir rm .git exec mv "$gitpath" .git -- 2.39.5