]> git.phdru.name Git - git-scripts.git/commitdiff
Refactor: Factor out run-recursive
authorOleg Broytman <phd@phdru.name>
Wed, 27 Feb 2019 23:24:11 +0000 (02:24 +0300)
committerOleg Broytman <phd@phdru.name>
Wed, 27 Feb 2019 23:24:11 +0000 (02:24 +0300)
fsck-recursive
gc-not-packed-recursive
run-recursive [new file with mode: 0755]
set-commit-date-recursive

index 3e47bd29f4bb2aa848a564d3538b9147de4897ff..43d6136400e225e701d19bcb55d09fc17de14683 100755 (executable)
@@ -1,8 +1,4 @@
 #! /bin/sh
 
 prog_dir="`dirname \"$0\"`" &&
-"$prog_dir"/fsck &&
-
-if [ -f .gitmodules ]; then
-   exec git submodule foreach "$prog_dir"/fsck
-fi
+exec "$prog_dir"/run-recursive "$prog_dir"/fsck
index ca1704315a8166dbb3ba86091abba215b14af23f..8d47871ea5d765129bab9991b06315a1e7cb95d1 100755 (executable)
@@ -1,8 +1,4 @@
 #! /bin/sh
 
 prog_dir="`dirname \"$0\"`" &&
-"$prog_dir"/gc-not-packed &&
-
-if [ -f .gitmodules ]; then
-   exec git submodule foreach "$prog_dir"/gc-not-packed
-fi
+exec "$prog_dir"/run-recursive "$prog_dir"/gc-not-packed
diff --git a/run-recursive b/run-recursive
new file mode 100755 (executable)
index 0000000..401ed27
--- /dev/null
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+"$@" &&
+
+if [ -f .gitmodules ]; then
+   exec git submodule foreach "$@"
+fi
index 2caa688e703b0515cde3a975a97c3ea2f4df5922..fd6852cb008b57fc61c997ed66fa568ba4281c74 100755 (executable)
@@ -1,10 +1,4 @@
 #! /bin/sh
 
-# Call set-commit-date on the repo and all submodules
-
 prog_dir="`dirname \"$0\"`" &&
-"$prog_dir"/set-commit-date.py && \
-
-if [ -f .gitmodules ]; then
-   exec git submodule foreach "$prog_dir"/set-commit-date.py
-fi
+exec "$prog_dir"/run-recursive "$prog_dir"/set-commit-date.py