Skip to content

Commit bc1bb28

Browse files
committed
test: add test for filemode
1 parent 0a0c9e0 commit bc1bb28

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

run-tests.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,37 @@ twigSplitTest() {
155155
cd ../
156156
}
157157

158+
filemodeTest() {
159+
rm -rf filemode
160+
mkdir filemode
161+
cd filemode
162+
git init > /dev/null
163+
164+
switchAsSammy "Sat, 24 Nov 1973 19:01:02 +0200" "Sat, 24 Nov 1973 19:11:22 +0200"
165+
echo "a" > a
166+
git add a
167+
git commit -m"added a" > /dev/null
168+
169+
switchAsFred "Sat, 24 Nov 1973 20:01:02 +0200" "Sat, 24 Nov 1973 20:11:22 +0200"
170+
mkdir b/
171+
echo "b" > b/b
172+
chmod +x b/b
173+
git add b
174+
git commit -m"added b" > /dev/null
175+
176+
$LITE_PATH --prefix=b/::not-important:also-not-important --target refs/heads/split 2>/dev/null
177+
FILEMODE=`git ls-tree -r --format='%(objectmode)' split b`
178+
179+
if test "$FILEMODE" = "100755"; then
180+
echo "Test #6 - OK"
181+
else
182+
echo "Test #6 - NOT OK"
183+
exit 1
184+
fi
185+
186+
cd ../
187+
}
188+
158189
LITE_PATH=`pwd`/splitsh-lite
159190
if [ ! -e $LITE_PATH ]; then
160191
echo "You first need to compile the splitsh-lite binary"
@@ -169,3 +200,4 @@ cd splitter-lite-tests
169200
simpleTest
170201
mergeTest
171202
twigSplitTest
203+
filemodeTest

0 commit comments

Comments
 (0)