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} "${@}"
}
_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
# 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
# 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"
if [ -z "${quiet}" ]; then
printf '%s ' ${SVN} "${@}"; printf '\n'
fi
+ _plain_svn "$@"
+}
+# Note: please keep command below aligned with what is printed above
+_plain_svn() {
eval ${SVN} "${@}"
}
# UTC timezone), which we can feed as-is to the --mtime option for tar.
# In case there is a redirection (e.g. http -> https), just keep the
# last line (svn outputs everything on stdout)
-date="$( _svn info "'${uri}@${rev}'" \
+date="$( _plain_svn info "'${uri}@${rev}'" \
|sed -r -e '/^Last Changed Date: /!d; s///'
)"