Workaround a problem in Git for Windows' bash

... where running './g pull -r' resulted in

  ln: failed to create symbolic link '.git/modules/dictionaries/hooks/*': No such file or directory
  ln: failed to create symbolic link '.git/modules/translations/hooks/*': No such file or directory

Change-Id: Ie0bd2eaca44f8b1a2ad2de9083bbefc779e213e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111948
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
This commit is contained in:
Mike Kaganski 2021-03-04 11:40:05 +03:00 committed by Mike Kaganski
parent 5e75b7ca82
commit 0e6e10cd3d

12
g
View file

@ -38,6 +38,9 @@ refresh_submodule_hooks()
if [ -d "${repo?}"/.git ] ; then
# use core's hook by default
for hook_name in "${COREDIR?}/.git-hooks"/* ; do
if [ ! -e "${hook_name}" ] ; then
continue
fi
hook="${repo?}/.git/hooks/${hook_name##*/}"
if [ ! -e "${hook?}" ] || [ -L "${hook?}" ] ; then
rm -f "${hook?}"
@ -46,6 +49,9 @@ refresh_submodule_hooks()
done
# override if need be by the submodules' own hooks
for hook_name in "${COREDIR?}/${repo?}/.git-hooks"/* ; do
if [ ! -e "${hook_name}" ] ; then
continue
fi
hook="${repo?}/.git/hooks/${hook_name##*/}"
if [ ! -e "${hook?}" ] || [ -L "${hook?}" ] ; then
rm -f "${hook?}"
@ -54,6 +60,9 @@ refresh_submodule_hooks()
done
elif [ -d .git/modules/"${repo}"/hooks ] ; then
for hook_name in "${COREDIR?}/.git-hooks"/* ; do
if [ ! -e "${hook_name}" ] ; then
continue
fi
hook=".git/modules/${repo?}/hooks/${hook_name##*/}"
if [ ! -e "${hook?}" ] || [ -L "${hook?}" ] ; then
rm -f "${hook?}"
@ -62,6 +71,9 @@ refresh_submodule_hooks()
done
# override if need be by the submodules' own hooks
for hook_name in "${COREDIR?}/${repo?}/.git-hooks"/* ; do
if [ ! -e "${hook_name}" ] ; then
continue
fi
hook=".git/modules/${repo?}/hooks/${hook_name##*/}"
if [ ! -e "${hook?}" ] || [ -L "${hook?}" ] ; then
rm -f "${hook?}"