commit 2af6fff5d5b5fc48f62848a7d99d9561632e73a7
parent 82720d6896df5fe48f836f272b337f1cba954922
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Sun, 8 Jun 2025 18:33:24 +0200
git-publish: fix issues with relative paths
Input repositories with a relative path presented publishing problems.
The symbolic links used to expose them publicly could be invalid.
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/git-publish b/git-publish
@@ -96,9 +96,13 @@ 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}" "${dir_git}"
+ ln -sf "${repo_abs}" "${dir_git}"
repo_git="${dir_git}/${repo_name}.git"
# Create directory publicly served by the WWW daemon