From d257d0e911a18d2c248fc44328917ef209542a95 Mon Sep 17 00:00:00 2001 From: Modestas Vainius Date: Sun, 18 Jul 2010 20:00:14 +0300 Subject: Initialize branches specified in the create repository ruleset. Otherwise, what's the point of that directive. Sometimes repository does not start from the master branch. --- src/repository.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/repository.cpp') diff --git a/src/repository.cpp b/src/repository.cpp index e6ea81c..c51496b 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -67,7 +67,7 @@ Repository::Repository(const Rules::Repository &rule) { foreach (Rules::Repository::Branch branchRule, rule.branches) { Branch branch; - branch.created = 0; // not created + branch.created = 1; branches.insert(branchRule.name, branch); } -- cgit v1.2.1 From 2ce7467917ef046dd9abfb1eb5464cd1ee7c7726 Mon Sep 17 00:00:00 2001 From: Modestas Vainius Date: Sun, 18 Jul 2010 20:01:41 +0300 Subject: Do not initialize master branch if branches were specified in the ruleset. --- src/repository.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/repository.cpp') diff --git a/src/repository.cpp b/src/repository.cpp index c51496b..e6c0f55 100644 --- a/src/repository.cpp +++ b/src/repository.cpp @@ -72,8 +72,9 @@ Repository::Repository(const Rules::Repository &rule) branches.insert(branchRule.name, branch); } - // create the default branch - branches["master"].created = 1; + // create the default branch if no branches were manually specified + if (rule.branches.length() == 0) + branches["master"].created = 1; fastImport.setWorkingDirectory(name); if (!CommandLineParser::instance()->contains("dry-run")) { -- cgit v1.2.1