mbien commented on code in PR #6528:
URL: https://github.com/apache/netbeans/pull/6528#discussion_r1353980383


##########
ide/libs.git/src/org/netbeans/libs/git/jgit/Utils.java:
##########
@@ -76,9 +79,28 @@ private Utils () {
     }
 
     public static Repository getRepositoryForWorkingDir (File workDir) throws 
IOException, IllegalArgumentException {
-         Repository repo = new 
FileRepositoryBuilder().setWorkTree(workDir).build();
-         repo.getConfig().setBoolean("pack", null, "buildbitmaps", false);
-         return repo;
+        FileRepositoryBuilder builder = new 
FileRepositoryBuilder().setWorkTree(workDir);
+        // Sets the initial ref name (in .git/HEAD), this is only written when 
repo.create() is called
+        // and doesn't affect existing repos. Initial ref is essentially the 
branch name after first commit.
+        try {
+            builder.setInitialBranch(getInitBranchName());
+        } catch (InvalidRefNameException | ConfigInvalidException ex) {
+            Logger.getLogger(Utils.class.getName()).log(Level.INFO, "can not 
set initial branch name", ex);
+        }

Review Comment:
   todo: add IOException to catch list here, since its from the config reader 
and shouldn't propagate out



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to