commit 2a9458b53f48c4622495e87a1dbc3650f49fcc3e
parent 57fe1703a13bf8c2ed88ede55167c440166a1a75
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Sun, 24 May 2026 16:40:27 +0200
git-barepo: handle repos whose path is a symlink
The symbolic links were not being followed.
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/git-barepo b/git-barepo
@@ -81,7 +81,7 @@ share() # repo, group
# Search for files in the repository that do NOT belong to the user.
# If there are any, the repository permissions cannot be updated.
- f="$(find "$1" ! -user "${u}")"
+ f="$(find -L "$1" ! -user "${u}")"
if [ -n "${f}" ]; then
>&2 printf 'Could not share the repository: '\
'some files do not belong to %s\n' "${u}"
@@ -89,8 +89,8 @@ share() # repo, group
fi
chown -R :"$2" "$1"
- find "$1" -type f -exec chmod "g+w" {} \;
- find "$1" -type d -exec chmod "g+ws" {} \;
+ find -L "$1" -type f -exec chmod "g+w" {} \;
+ find -L "$1" -type d -exec chmod "g+ws" {} \;
cd -- "$1"
git config --local core.sharedRepository group
cd -- "${OLDPWD}"
@@ -104,7 +104,7 @@ privatise() # repo
# Search for files in the repository that do NOT belong to the user.
# If there are any, the repository permissions cannot be updated.
- f="$(find "$1" ! -user "${u}")"
+ f="$(find -L "$1" ! -user "${u}")"
if [ -n "${f}" ]; then
>&2 printf 'Could not privatise the repository: '\
'some files do not belong to %s\n' "${u}"
@@ -115,8 +115,8 @@ privatise() # repo
dgperm="$(dir_grp_priv_perm)"
chown -R :"${g}" "$1"
- find "$1" -type f -exec chmod "${fgperm}" {} \;
- find "$1" -type d -exec chmod "${dgperm}" {} \;
+ find -L "$1" -type f -exec chmod "${fgperm}" {} \;
+ find -L "$1" -type d -exec chmod "${dgperm}" {} \;
cd -- "$1"
git config --local core.sharedRepository false
cd -- "${OLDPWD}"