diff options
author | Christian Couder <christian.couder@gmail.com> | 2017-06-25 06:34:28 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-06-25 10:42:52 -0700 |
commit | 73de1c93adbdac279c10668afbc7ba6e48a7ccac (patch) | |
tree | 246288b78b4ff3ddc3af3d6c6727bde80e630a35 /t/test-lib-functions.sh | |
parent | read-cache: use shared perms when writing shared index (diff) | |
download | tgif-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.sh | 5 |
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= |