summaryrefslogtreecommitdiff
path: root/t/test-lib-functions.sh
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2017-06-25 04:34:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-25 17:42:52 (GMT)
commit73de1c93adbdac279c10668afbc7ba6e48a7ccac (patch)
tree246288b78b4ff3ddc3af3d6c6727bde80e630a35 /t/test-lib-functions.sh
parentdf801f3f9f5be52842239f0d0233d5c3fb0cdffd (diff)
downloadgit-73de1c93adbdac279c10668afbc7ba6e48a7ccac.zip
git-73de1c93adbdac279c10668afbc7ba6e48a7ccac.tar.gz
git-73de1c93adbdac279c10668afbc7ba6e48a7ccac.tar.bz2
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 5ee1243..db622c3 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=