summaryrefslogtreecommitdiff
path: root/doc/todo/Support_for_mirroring_bare_git_repos/comment_1_f8d0ade5f31f85c1db50b3ec6a9a3818._comment
blob: fb6ff1773276bb36ce9c8c8419052fa73abdb98f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
[[!comment format=mdwn
 username="david"
 avatar="http://cdn.libravatar.org/avatar/22c2d800db6a7699139df604a67cb221"
 subject="first attempt"
 date="2020-05-16T23:44:41Z"
 content="""
This isn't very general, but it seems to work

[[!format haskell \"\"\"
bareMirror :: String -> String -> Property  DebianLike
bareMirror dir url = propertyList (\"bare mirror of \" ++ url ++ \" in \" ++ dir ) $ props
  & Git.installed
  & Git.bareRepo dir (User \"root\") Git.SharedAll
  & Git.repoConfigured dir (\"remote.origin.url\", url)
  & Git.repoConfigured dir (\"remote.origin.mirror\", \"true\")
  & Git.repoConfigured dir (\"remote.origin.fetch\", \"+refs/*:refs/*\")
  & Cmd.cmdProperty \"git\" [\"-C\", dir, \"fetch\", \"origin\" ] `changesFileContent` (dir </> \"HEAD\")
\"\"\"]]
"""]]