summaryrefslogtreecommitdiff
path: root/t/test-lib-functions.sh
diff options
context:
space:
mode:
authorLibravatar Christian Couder <christian.couder@gmail.com>2017-06-25 06:34:28 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-06-25 10:42:52 -0700
commit73de1c93adbdac279c10668afbc7ba6e48a7ccac (patch)
tree246288b78b4ff3ddc3af3d6c6727bde80e630a35 /t/test-lib-functions.sh
parentread-cache: use shared perms when writing shared index (diff)
downloadtgif-73de1c93adbdac279c10668afbc7ba6e48a7ccac.tar.xz
t1301: move modebits() to test-lib-functions.sh
As the modebits() function can be useful outside t1301, let's move it into test-lib-functions.sh, and while at it let's rename it test_modebits(). Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/test-lib-functions.sh')
-rw-r--r--t/test-lib-functions.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
index 5ee124332a..db622c3555 100644
--- a/t/test-lib-functions.sh
+++ b/t/test-lib-functions.sh
@@ -216,6 +216,11 @@ test_chmod () {
git update-index --add "--chmod=$@"
}
+# Get the modebits from a file.
+test_modebits () {
+ ls -l "$1" | sed -e 's|^\(..........\).*|\1|'
+}
+
# Unset a configuration variable, but don't fail if it doesn't exist.
test_unconfig () {
config_dir=