Skip to content

Commit b7f44fd

Browse files
razehEric Wong
authored andcommitted
git svn: add test for a git svn gc followed by a git svn mkdirs
git svn gc will compress the unhandled.log files that git svn mkdirs reads, causing git svn mkdirs to skip directory creation. [ew: trivial whitespace cleanups] Acked-by: Eric Wong <[email protected]> Signed-off-by: Robert Zeh <[email protected]>
1 parent 150d38c commit b7f44fd

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

t/t9152-svn-empty-dirs-after-gc.sh

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/sh
2+
#
3+
# Copyright (c) 2009 Robert Zeh
4+
5+
test_description='git svn creates empty directories, calls git gc, makes sure they are still empty'
6+
. ./lib-git-svn.sh
7+
8+
test_expect_success 'initialize repo' '
9+
for i in a b c d d/e d/e/f "weird file name"
10+
do
11+
svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i"
12+
done
13+
'
14+
15+
test_expect_success 'clone' 'git svn clone "$svnrepo" cloned'
16+
17+
test_expect_success 'git svn gc runs' '
18+
(
19+
cd cloned &&
20+
git svn gc
21+
)
22+
'
23+
24+
test_expect_success 'git svn mkdirs recreates empty directories after git svn gc' '
25+
(
26+
cd cloned &&
27+
rm -r * &&
28+
git svn mkdirs &&
29+
for i in a b c d d/e d/e/f "weird file name"
30+
do
31+
if ! test -d "$i"
32+
then
33+
echo >&2 "$i does not exist"
34+
exit 1
35+
fi
36+
done
37+
)
38+
'
39+
40+
test_done

0 commit comments

Comments
 (0)