From: Lady Date: Sun, 5 Apr 2026 20:06:43 +0000 (-0400) Subject: Try to detect bare repositories with git X-Git-Tag: 0.2.0~1 X-Git-Url: https://git.ladys.computer/HOMEDIR/commitdiff_plain/f5fa906adf4a643a4fefccb9cd613f055c491d529008bfe0f26ab9335d1241c9 Try to detect bare repositories with git If a directory has a `refs´ subdirectory, it should be assumed that it is a Git directory (either a bare one or a `.git´ directory in a working tree). These cases are now treated equivalently to those where a `.git´ file or directory is present. Ideally, this detection would walk the file tree upward (at least until `${PSEUDDIR}´ is encountered). But the current behaviour is good enough for the immediate usecases, namely “updating git submodules” and “operating in bare git directories”, which do not require further subdirectory support. Message-type: text/lesml --- diff --git a/sh/git.sh b/sh/git.sh index 4c82e98..d2e3710 100755 --- a/sh/git.sh +++ b/sh/git.sh @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# @(#)🏠📂 HOMEDIR sh/git.sh 2026-04-05T20:05:34Z +# @(#)🏠📂 HOMEDIR sh/git.sh 2026-04-05T20:06:43Z # SPDX-FileCopyrightText: 2026 Lady # SPDX-License-Identifier: MPL-2.0 @@ -179,10 +179,12 @@ else : "${cmd_TOUCH}" "${configfile}" fi -## If a `.git´ file or directory exists, Git is simply provided with -## the correct configuration but is otherwise called normally. +## If a `.git´ file or directory exists or there is a `refs´ directory, +## Git is provided with the correct configuration but is otherwise +## called normally. - if "${cmd_TEST}" -e "${realpwd}"'/.git' + if "${cmd_TEST}" -e "${realpwd}"'/.git' || + "${cmd_TEST}" -d "${realpwd}"'/refs' then : "${cmd_GIT}" -c "include.path=${configfile}" "$@"