From 60fffe0bac248d3f2c9ce74da1752b996226be59 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 5 Jan 2016 12:43:07 +0000 Subject: Git.bareRepoDefaultBranch property Signed-off-by: Sean Whitton (cherry picked from commit e17fda60d307cbdde1a1735b379fa5b19e5dbe4a) --- src/Propellor/Property/Git.hs | 10 ++++++++++ 1 file changed, 10 insertions(+) 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) -- cgit v1.3-2-g0d8e From 3d5dff437d05388eed90b0c91f6521ac80be3703 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 5 Jan 2016 13:30:17 -0400 Subject: improve doc --- src/Propellor/Property/Git.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Propellor/Property/Git.hs b/src/Propellor/Property/Git.hs index 1deda951..a5ef5ab1 100644 --- a/src/Propellor/Property/Git.hs +++ b/src/Propellor/Property/Git.hs @@ -150,7 +150,8 @@ repoAcceptsNonFFs repo = accepts refuses `describe` desc "rejects" desc s = "git repo " ++ repo ++ " " ++ s ++ " non-fast-forward pushes" --- | Sets a bare repository's default branch. +-- | 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") -- cgit v1.3-2-g0d8e From 9eb4c127dd8cfd351f4e39931162b324781df53d Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 5 Jan 2016 13:30:39 -0400 Subject: changelog --- debian/changelog | 7 +++++++ 1 file changed, 7 insertions(+) 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 Tue, 05 Jan 2016 13:30:21 -0400 + propellor (2.15.2) unstable; urgency=medium * Added GNUPGBIN environment variable or git.program git config -- cgit v1.3-2-g0d8e