[Git][ghc/ghc][wip/b/no-chown] Only do submodule clean on Windows

Bryan R (@chreekat) gitlab at gitlab.haskell.org
Thu Jan 25 08:13:40 UTC 2024



Bryan R pushed to branch wip/b/no-chown at Glasgow Haskell Compiler / GHC


Commits:
0f9e0829 by Bryan Richter at 2024-01-25T10:13:14+02:00
Only do submodule clean on Windows

According to the comment, that's the only platform where it's needed,
anyway.

- - - - -


1 changed file:

- .gitlab/ci.sh


Changes:

=====================================
.gitlab/ci.sh
=====================================
@@ -366,17 +366,21 @@ function setup_toolchain() {
 
 function cleanup_submodules() {
   start_section "clean submodules"
-  if [ -d .git ]; then
-    info "Cleaning submodules..."
-    # On Windows submodules can inexplicably get into funky states where git
-    # believes that the submodule is initialized yet its associated repository
-    # is not valid. Avoid failing in this case with the following insanity.
-    git submodule sync || git submodule deinit --force --all
-    git submodule update --init
-    git submodule foreach git clean -xdf
-  else
-    info "Not cleaning submodules, not in a git repo"
-  fi;
+  case "$(uname)" in
+    MSYS_*|MINGW*)
+        if [ -d .git ]; then
+            info "Cleaning submodules..."
+            # On Windows submodules can inexplicably get into funky states where git
+            # believes that the submodule is initialized yet its associated repository
+            # is not valid. Avoid failing in this case with the following insanity.
+            git submodule sync || git submodule deinit --force --all
+            git submodule update --init
+            git submodule foreach git clean -xdf
+        else
+            info "Not cleaning submodules, not in a git repo"
+        fi;
+        ;;
+  esac
   end_section "clean submodules"
 }
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0f9e0829b99ab080aa1fe7a66501813d50106585

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/0f9e0829b99ab080aa1fe7a66501813d50106585
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240125/72b15777/attachment-0001.html>


More information about the ghc-commits mailing list