summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--debian/changelog7
-rw-r--r--src/Propellor/Property/Git.hs11
2 files changed, 18 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 997c3df3..e2aaa670 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+propellor (2.15.3) UNRELEASED; urgency=medium
+
+ * Added Git.bareRepoDefaultBranch property
+ Thanks, Sean Whitton.
+
+ -- Joey Hess <id@joeyh.name> Tue, 05 Jan 2016 13:30:21 -0400
+
propellor (2.15.2) unstable; urgency=medium
* Added GNUPGBIN environment variable or git.program git config
diff --git a/src/Propellor/Property/Git.hs b/src/Propellor/Property/Git.hs
index 46f6abc7..a5ef5ab1 100644
--- a/src/Propellor/Property/Git.hs
+++ b/src/Propellor/Property/Git.hs
@@ -149,3 +149,14 @@ 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, which will be checked out
+-- when cloning it.
+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)