chiark / gitweb /
test suite: Introduce playtree-save-refs
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 12 Jul 2018 12:32:11 +0000 (13:32 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 12 Jul 2018 12:44:16 +0000 (13:44 +0100)
Arranges for all the refs in each playtree to be saved in the parent's
ref namespace.

This is going to be used when running git-gc when saving artifacts.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
tests/playtree-save-refs [new file with mode: 0755]

diff --git a/tests/playtree-save-refs b/tests/playtree-save-refs
new file mode 100755 (executable)
index 0000000..7841367
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -e
+set -o pipefail
+find -name .git -type d -exec sh -xec '
+       cd "$1"
+       git for-each-ref \
+ --format='\''update refs/dgit-test-keep/g%(objectname) %(objectname)'\'' \
+' x "{}" \; | \
+       sort -u | git update-ref --stdin