git svn: add authorsfile test case for ~/.gitconfig
The commit for: git svn: read global+system config for clone+init Initially lacked a test case because the author was unable to reproduce it under his test environment, this adds it. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong committed
Nov 14, 2009 at 14:43 UTC
e2f8617b266e320fd58ab584cae2ebe9906daaac
1 file changed
+23
t/t9130-git-svn-authors-file.sh
+23
@@ -91,4 +91,27 @@ test_expect_success 'fetch continues after authors-file is fixed' '
91
)
92
'
93
94
+test_expect_success 'fresh clone with svn.authors-file in config' '
95
+ (
96
+ rm -r "$GIT_DIR" &&
97
+ test x = x"$(git config svn.authorsfile)" &&
98
+ HOME="`pwd`" &&
99
+ export HOME &&
100
+ test_config="$HOME"/.gitconfig &&
101
+ unset GIT_CONFIG_NOGLOBAL &&
102
+ unset GIT_DIR &&
103
+ unset GIT_CONFIG &&
104
+ git config --global \
105
+ svn.authorsfile "$HOME"/svn-authors &&
106
+ test x"$HOME"/svn-authors = x"$(git config svn.authorsfile)" &&
107
+ git svn clone "$svnrepo" gitconfig.clone &&
108
+ cd gitconfig.clone &&
109
+ nr_ex=$(git log | grep "^Author:.*example.com" | wc -l) &&
110
+ nr_rev=$(git rev-list HEAD | wc -l) &&
111
+ test $nr_rev -eq $nr_ex
112
+ )
113
+'
114
+
115
+test_debug 'GIT_DIR=gitconfig.clone/.git git log'
116
+
117
test_done