]> git.phdru.name Git - git-scripts.git/commitdiff
Feat: Check recursively for detached `HEAD`
authorOleg Broytman <phd@phdru.name>
Sun, 2 Aug 2020 22:52:02 +0000 (01:52 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 2 Aug 2020 22:52:02 +0000 (01:52 +0300)
detached-head/check-detached-head [new file with mode: 0755]
detached-head/check-detached-head-recursive [new file with mode: 0755]
detached-head/check-detached-head-repos [new file with mode: 0755]

diff --git a/detached-head/check-detached-head b/detached-head/check-detached-head
new file mode 100755 (executable)
index 0000000..22471c5
--- /dev/null
@@ -0,0 +1,2 @@
+#! /bin/sh
+git symbolic-ref -q HEAD >/dev/null || pwd
diff --git a/detached-head/check-detached-head-recursive b/detached-head/check-detached-head-recursive
new file mode 100755 (executable)
index 0000000..e184e40
--- /dev/null
@@ -0,0 +1,4 @@
+#! /bin/sh
+
+prog_dir="`dirname \"$0\"`" &&
+exec "$prog_dir"/../run-recursive "$prog_dir"/check-detached-head
diff --git a/detached-head/check-detached-head-repos b/detached-head/check-detached-head-repos
new file mode 100755 (executable)
index 0000000..5590d73
--- /dev/null
@@ -0,0 +1,7 @@
+#! /bin/sh
+
+cd "`dirname \"$0\"`" &&
+prog_dir="`pwd`" &&
+export prog_dir
+
+exec "$prog_dir"/../run-repos "$prog_dir"/check-detached-head-recursive