summaryrefslogtreecommitdiff
path: root/Test.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-02-04 14:23:41 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-02-04 14:31:52 -0400
commit53518c58de6245763f570cbea0a84bbf7d1347eb (patch)
treedebeeb00c61ef2c5a6f7877019d4816ff8bed6f8 /Test.hs
parent348ae0c980b690f303f04e4d5d828bf3c0cb65a4 (diff)
set up git email config in clone repos too when running test
This fixes the problem of the environment variables apparently not being seen on Windows. I could probably remove the setting of the env vars from Test.hs now as this covers it better. Note that outside the test suite, git-annex on windows seems to manage to configure the repo so commits work on its own.
Diffstat (limited to 'Test.hs')
-rw-r--r--Test.hs13
1 files changed, 9 insertions, 4 deletions
diff --git a/Test.hs b/Test.hs
index 779754677..3357c73be 100644
--- a/Test.hs
+++ b/Test.hs
@@ -948,7 +948,8 @@ test_rsync_remote env = intmpclonerepo env $ do
not <$> git_annex env "drop" [annexedfile, "--numcopies=2"] @? "drop failed to fail"
annexed_present annexedfile
#else
- -- this test doesn't work in Windows TODO
+ -- Rsync remotes with a rsyncurl of a directory do not currently
+ -- work on Windows.
noop
#endif
@@ -1140,9 +1141,7 @@ setuprepo env dir = do
cleanup dir
ensuretmpdir
boolSystem "git" [Params "init -q", File dir] @? "git init failed"
- indir env dir $ do
- boolSystem "git" [Params "config user.name", Param "Test User"] @? "git config failed"
- boolSystem "git" [Params "config user.email test@example.com"] @? "git config failed"
+ configrepo env dir
return dir
-- clones are always done as local clones; we cannot test ssh clones
@@ -1154,11 +1153,17 @@ clonerepo env old new bare = do
boolSystem "git" [Params ("clone -q" ++ b), File old, File new] @? "git clone failed"
indir env new $
git_annex env "init" ["-q", new] @? "git annex init failed"
+ configrepo env new
when (not bare) $
indir env new $
handleforcedirect env
return new
+configrepo :: TestEnv -> FilePath -> IO ()
+configrepo env dir = indir env dir $ do
+ boolSystem "git" [Params "config user.name", Param "Test User"] @? "git config failed"
+ boolSystem "git" [Params "config user.email test@example.com"] @? "git config failed"
+
handleforcedirect :: TestEnv -> IO ()
handleforcedirect env = when (M.lookup "FORCEDIRECT" env == Just "1") $
git_annex env "direct" ["-q"] @? "git annex direct failed"