From: Oleg Broytman Date: Tue, 6 Feb 2024 22:16:27 +0000 (+0300) Subject: Feat(unabsorbgitdirs): Add a sentinel X-Git-Url: https://git.phdru.name/?a=commitdiff_plain;h=50a94c682ccd5d2ab4cf2cfe954a10132077e608;p=git-scripts.git Feat(unabsorbgitdirs): Add a sentinel Check "gitdir:". --- 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