Skip to content
Snippets Groups Projects
Commit f533a528 authored by Sam Gleske's avatar Sam Gleske
Browse files

Force --no-delete if --no-create

If project was created with --no-create option set then it doesn't
make sense to attempt to delete the remote.  This will force the
option no matter if --delete or --no-delete are given.
parent cc507fb5
No related branches found
No related tags found
No related merge requests found
......@@ -375,6 +375,9 @@ if ${git};then
git fetch
git remote prune origin
git push gitlab
if [ ! -z "${no_create}" ];then
git config gitlabmirrors.nocreate true
fi
green_echo "All done!" 1>&2
elif ${svn};then
#create a mirror
......
......@@ -141,6 +141,12 @@ if ! ${quiet};then
fi
fi
pushd "${repo_dir}/${gitlab_namespace}/${project_name}" &> /dev/null
if git config --get gitlabmirrors.nocreate &> /dev/null && [ "$(git config --get gitlabmirrors.nocreate)" = "true" ];then
no_delete=true
fi
popd &> /dev/null
rm -rf "${repo_dir}/${gitlab_namespace}/${project_name}"
green_echo -n "DELETED" 1>&2
echo " ${repo_dir}/${gitlab_namespace}/${project_name}" 1>&2
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment