diff options
| author | Sean Whitton <spwhitton@spwhitton.name> | 2016-01-05 12:43:07 +0000 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-01-05 13:30:09 -0400 |
| commit | 60fffe0bac248d3f2c9ce74da1752b996226be59 (patch) | |
| tree | c7d0695714b3f1de095eb1f2fb5f07d86cbdc82a /src | |
| parent | fc6b042daf2a1714485373cec1c7475855799f71 (diff) | |
Git.bareRepoDefaultBranch property
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
(cherry picked from commit e17fda60d307cbdde1a1735b379fa5b19e5dbe4a)
Diffstat (limited to 'src')
| -rw-r--r-- | src/Propellor/Property/Git.hs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/Propellor/Property/Git.hs b/src/Propellor/Property/Git.hs index 46f6abc7..1deda951 100644 --- a/src/Propellor/Property/Git.hs +++ b/src/Propellor/Property/Git.hs @@ -149,3 +149,13 @@ repoAcceptsNonFFs repo = accepts <!> refuses refuses = repoConfigured repo ("receive.denyNonFastForwards", "true") `describe` desc "rejects" desc s = "git repo " ++ repo ++ " " ++ s ++ " non-fast-forward pushes" + +-- | Sets a bare repository's default branch. +bareRepoDefaultBranch :: FilePath -> String -> Property NoInfo +bareRepoDefaultBranch repo branch = + userScriptProperty (User "root") + [ "cd " ++ repo + , "git symbolic-ref HEAD refs/heads/" ++ branch + ] + `changesFileContent` (repo </> "HEAD") + `describe` ("git repo at " ++ repo ++ " has default branch " ++ branch) |
