summaryrefslogtreecommitdiff
path: root/t/t6031-merge-recursive.sh
diff options
context:
space:
mode:
authorJohannes Sixt <j6t@kdbg.org>2009-02-28 20:12:57 (GMT)
committerJohannes Sixt <j6t@kdbg.org>2009-03-19 20:47:14 (GMT)
commit1f553918a8482ea792e8cd4d5d2c75fe60f68aae (patch)
tree1227021499212fafc4d70e2030813598f68292c0 /t/t6031-merge-recursive.sh
parent8586f98bd29bd4ad3d0e62a3be4a4d59ff8b27cd (diff)
downloadgit-1f553918a8482ea792e8cd4d5d2c75fe60f68aae.zip
git-1f553918a8482ea792e8cd4d5d2c75fe60f68aae.tar.gz
git-1f553918a8482ea792e8cd4d5d2c75fe60f68aae.tar.bz2
test-lib: Introduce test_chmod and use it instead of update-index --chmod
This function replaces sequences of 'chmod +x' and 'git update-index --chmod=+x' in the test suite, whose purpose is to help filesystems that need core.filemode=false. Two places where only 'chmod +x' was used we also use this new function. The function calls 'git update-index --chmod' without checking core.filemode (unlike some of the call sites did). We do this because the call sites *expect* that the executable bit ends up in the index (ie. it is not the purpose of the call sites to *test* whether git treats 'chmod +x' and 'update-index --chmod=+x' correctly). Therefore, on filesystems with core.filemode=true the 'git update-index --chmod' is a no-op. The function uses --add with update-index to help one call site in t6031-merge-recursive. It makes no difference for the other callers. Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Diffstat (limited to 't/t6031-merge-recursive.sh')
-rwxr-xr-xt/t6031-merge-recursive.sh9
1 files changed, 2 insertions, 7 deletions
diff --git a/t/t6031-merge-recursive.sh b/t/t6031-merge-recursive.sh
index 8073e0c..41c6860 100755
--- a/t/t6031-merge-recursive.sh
+++ b/t/t6031-merge-recursive.sh
@@ -3,9 +3,6 @@
test_description='merge-recursive: handle file mode'
. ./test-lib.sh
-# Note that we follow "chmod +x F" with "update-index --chmod=+x F" to
-# help filesystems that do not have the executable bit.
-
test_expect_success 'mode change in one branch: keep changed version' '
: >file1 &&
git add file1 &&
@@ -15,8 +12,7 @@ test_expect_success 'mode change in one branch: keep changed version' '
git add dummy &&
git commit -m a &&
git checkout -b b1 master &&
- chmod +x file1 &&
- git update-index --chmod=+x file1 &&
+ test_chmod +x file1 &&
git commit -m b1 &&
git checkout a1 &&
git merge-recursive master -- a1 b1 &&
@@ -28,8 +24,7 @@ test_expect_success 'mode change in both branches: expect conflict' '
git checkout -b a2 master &&
: >file2 &&
H=$(git hash-object file2) &&
- chmod +x file2 &&
- git update-index --add --chmod=+x file2 &&
+ test_chmod +x file2 &&
git commit -m a2 &&
git checkout -b b2 master &&
: >file2 &&