File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -326,8 +326,18 @@ FastImportRepository::FastImportRepository(const Rules::Repository &rule)
326326 branches.insert (branchRule.name , branch);
327327 }
328328
329- // create the default branch
330- branches[" master" ].created = 1 ;
329+ // create the defaultBranch from the config
330+ QProcess config;
331+ config.start (" git" , QStringList () << " config" << " init.defaultBranch" );
332+ config.waitForFinished (-1 );
333+ QString defaultBranch = QString (config.readAllStandardOutput ()).trimmed ();
334+
335+ // Create the default branch
336+ if (defaultBranch.isEmpty ()) {
337+ branches[" master" ].created = 1 ;
338+ } else {
339+ branches[defaultBranch].created = 1 ;
340+ }
331341
332342 if (!CommandLineParser::instance ()->contains (" dry-run" ) && !CommandLineParser::instance ()->contains (" create-dump" )) {
333343 fastImport.setWorkingDirectory (name);
You can’t perform that action at this time.
0 commit comments