- submod_path = os.path.join(self.rust_root, path)
-
- if status == ' ':
- run(["git", "reset", "--hard"], cwd=submod_path)
- run(["git", "clean", "-fdx"], cwd=submod_path)
- elif status == '+':
- run(["git", "submodule", "update", path], cwd=self.rust_root)
- run(["git", "reset", "--hard"], cwd=submod_path)
- run(["git", "clean", "-fdx"], cwd=submod_path)
- elif status == '-':
- run(["git", "submodule", "init", path], cwd=self.rust_root)
- run(["git", "submodule", "update", path], cwd=self.rust_root)
- else:
- raise ValueError('unknown submodule status: ' + status)
+ run(["git", "submodule", "update",
+ "--init", module], cwd=self.rust_root)
+ run(["git", "submodule", "-q", "foreach", "git",
+ "reset", "-q", "--hard"], cwd=self.rust_root)
+ run(["git", "submodule", "-q", "foreach", "git",
+ "clean", "-qdfx"], cwd=self.rust_root)
+