git-repo

Tools for sharing git bare repositories
git clone git://git.meso-star.fr/git-repo.git
Log | Files | Refs | README | LICENSE

commit e08e56f6fecd793ef5520f26118b4326811b12ee
parent 951f882f861c44aaaca21462e99f5c11368aa83b
Author: Vincent Forest <vincent.forest@meso-star.com>
Date:   Sat, 21 Jun 2025 15:33:25 +0200

git-publish: fix problems with the "." path.

The attempt to publish the current directory, even if it was a bare git
repository, failed. The relative path "." was not correctly supported.
Corrects this problem by making repository paths absolute.

Diffstat:
Mgit-publish | 13++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/git-publish b/git-publish @@ -96,13 +96,9 @@ publish_repo() { repo_name=$(basename "${repo}" ".git") - # Make the repository path absolute to ensure the validity of the - # symbolic link to it - repo_abs="$(cd -- "${repo}" && echo "${PWD}")" - # Publish the git repository, i.e. create a symbolic link to it in the # publicly exposed directory - ln -sf "${repo_abs}" "${dir_git}" + ln -sf "${repo}" "${dir_git}" repo_git="${dir_git}/${repo_name}.git" # Create directory publicly served by the WWW daemon @@ -222,6 +218,10 @@ make_index() publish() # list of repositories { printf '%s\n' "$@" | while read -r repo; do + # Make the repository path absolute to ensure both the validity of + # the symbolic link and a valid repository name + repo="$(cd -- "${repo}" && echo "${PWD}")" + printf '%s: ' "${repo}" check_repo publish_repo @@ -239,6 +239,9 @@ publish() # list of repositories unpublish() { printf '%s\n' "$@" | while read -r repo; do + # Make the repository path absolute to ensure both the validity of + # the symbolic link and a valid repository name + repo="$(cd -- "${repo}" && echo "${PWD}")" printf '%s: ' "${repo}" check_repo