|
@@ -82,6 +82,10 @@ _git() {
|
|
|
if [ -z "${quiet}" ]; then
|
|
|
printf '%s ' GIT_DIR="${git_cache}/.git" ${GIT} "${@}"; printf '\n'
|
|
|
fi
|
|
|
+ _plain_git "$@"
|
|
|
+}
|
|
|
+# Note: please keep command below aligned with what is printed above
|
|
|
+_plain_git() {
|
|
|
eval GIT_DIR="${git_cache}/.git" ${GIT} "${@}"
|
|
|
}
|
|
|
|
|
@@ -115,7 +119,7 @@ _EOF_
|
|
|
_git init .
|
|
|
|
|
|
# Ensure the repo has an origin (in case a previous run was killed).
|
|
|
-if ! _git remote |grep -q -E '^origin$'; then
|
|
|
+if ! _plain_git remote |grep -q -E '^origin$'; then
|
|
|
_git remote add origin "'${uri}'"
|
|
|
fi
|
|
|
|
|
@@ -181,7 +185,7 @@ _git clean -ffdx
|
|
|
|
|
|
# Get date of commit to generate a reproducible archive.
|
|
|
# %ci is ISO 8601, so it's fully qualified, with TZ and all.
|
|
|
-date="$( _git log -1 --pretty=format:%ci )"
|
|
|
+date="$( _plain_git log -1 --pretty=format:%ci )"
|
|
|
|
|
|
# There might be submodules, so fetch them.
|
|
|
if [ ${recurse} -eq 1 ]; then
|
|
@@ -194,7 +198,7 @@ if [ ${recurse} -eq 1 ]; then
|
|
|
# versions. However, we can't do that if git is too old and uses
|
|
|
# full repositories for submodules.
|
|
|
cmd='printf "%s\n" "${path}/"'
|
|
|
- for module_dir in $( _git submodule --quiet foreach "'${cmd}'" ); do
|
|
|
+ for module_dir in $( _plain_git submodule --quiet foreach "'${cmd}'" ); do
|
|
|
[ -f "${module_dir}/.git" ] || continue
|
|
|
relative_dir="$( sed -r -e 's,/+,/,g; s,[^/]+/,../,g' <<<"${module_dir}" )"
|
|
|
sed -r -i -e "s:^gitdir\: $(pwd)/:gitdir\: "${relative_dir}":" "${module_dir}/.git"
|