Browse Source

ShellCheck 2181

* Ne pas utiliser $?
* https://github.com/koalaman/shellcheck/wiki/SC2181
svn/root/trunk
cam.lafit 3 years ago
parent
commit
4efee4a6c1
  1. 6
      git_loader.sh

6
git_loader.sh

@ -46,13 +46,11 @@ function clone_git() {
git -C "$repo_name" remote add origin "$repo_git" >/dev/null 2>&1
fi
git -C "$repo_name" config --add remote.origin.fetch "+refs/svn/map:refs/notes/commits" >/dev/null 2>&1
git -C "$repo_name" fetch --all -t >/dev/null 2>&1
if [[ "$?" != "0" ]]; then
if ! git -C "$repo_name" fetch --all -t >/dev/null 2>&1; then
git -C "$repo_name" config --unset-all remote.origin.fetch "\\+refs\\/svn\\/map:refs\\/notes\\/commits"
git -C "$repo_name" fetch --all -t >/dev/null 2>&1
fi
git -C "$repo_name" reset --hard "$version" >/dev/null 2>&1
if [[ "$?" != "0" ]]; then
if ! git -C "$repo_name" reset --hard "$version" >/dev/null 2>&1; then
git -C "$repo_name" checkout --orphan orphan
git -C "$repo_name" reset --hard
else

Loading…
Cancel
Save