commit 8585c96ff2fa104932803dfef4291a55d8cc53c8
parent 1209651978e2b11399a18bf1d74d414595683ed5
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Sun, 25 Oct 2026 22:52:39 +0100
git-publish: fix an error in case of double publication
An error was reported when re-publishing a repository to the same git
directory : the paths to the source and to the destination were detected
as beeing the same. This is because the absolute paths to these
directories were defined by resolving the symbolic links. Hence the
problem since publishing a repository consists in creating a symbolic
link to it in the publication directory. Once the symbolic links are
resolved, the 2 repositories are the same.
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/git-publish b/git-publish
@@ -293,11 +293,10 @@ publish_repo()
# shellcheck disable=SC2310
check_repo "${_repo_git}" || return 1
- _dir0="$(cd "${_repo_git}" && pwd -P)"
- _dir1="$(cd "${_repo}" && pwd -P)"
-
# Check that the directory where to publish the repository is not
# the directory where the repository is located.
+ _dir0="$(cd "${_repo_git}" && pwd -L)"
+ _dir1="$(cd "${_repo}" && pwd -L)"
if [ "${_dir0}" = "${_dir1}" ]; then
>&2 printf \
'the directory "%s" where to publish the repository "%s" '\
@@ -308,6 +307,8 @@ publish_repo()
# If the path to the published repository already exists,
# verify that it matches the repository to publish...
+ _dir0="$(cd "${_repo_git}" && pwd -P)"
+ _dir1="$(cd "${_repo}" && pwd -P)"
if [ "${_dir0}" != "${_dir1}" ]; then
>&2 printf \
'"%s" already exists and is not the public version of "%s"\n' \