ebarboni commented on code in PR #9686:
URL: https://github.com/apache/netbeans/pull/9686#discussion_r4221651977


##########
ide/libs.git/test/unit/src/org/netbeans/libs/git/jgit/commands/PullTest.java:
##########
@@ -246,49 +245,49 @@ public void testPullChangesInOtherBranchPlusMerge () 
throws Exception {
         assertTrue(f2.exists());
     }
 
-    public void testPullFailOnLocalChanges () throws Exception {
+    public void testPullFailOnLocalChanges() throws Exception {
         GitClient client = getClient(workDir);
-        client.pull(otherWT.toURI().toString(), Arrays.asList(new String[] { 
"+refs/heads/*:refs/remotes/origin/*" }), "origin/master", 
NULL_PROGRESS_MONITOR);
+        client.pull(otherWT.toURI().toString(), Arrays.asList(new 
String[]{"+refs/heads/*:refs/remotes/origin/*"}), "origin/" + 
Constants.DEFAULT_BRANCH, NULL_PROGRESS_MONITOR);
         File f = new File(workDir, this.f.getName());
         write(f, "local change");
         add(f);
         Map<String, GitBranch> branches = client.getBranches(true, 
NULL_PROGRESS_MONITOR);
-        
-        makeRemoteChange("master");
+
+        makeRemoteChange(Constants.DEFAULT_BRANCH);
         try {
-            GitPullResult result = client.pull(otherWT.toURI().toString(), 
Arrays.asList(new String[] { "+refs/heads/*:refs/remotes/origin/*" }), 
"origin/master", NULL_PROGRESS_MONITOR);
+            GitPullResult result = client.pull(otherWT.toURI().toString(), 
Arrays.asList(new String[]{"+refs/heads/*:refs/remotes/origin/*"}), "origin/" + 
Constants.DEFAULT_BRANCH, NULL_PROGRESS_MONITOR);
             fail("Should fail");
         } catch (GitException.CheckoutConflictException ex) {
             // OK
         }
-        client.reset("master", GitClient.ResetType.HARD, 
NULL_PROGRESS_MONITOR);
+        client.reset(Constants.DEFAULT_BRANCH, GitClient.ResetType.HARD, 
NULL_PROGRESS_MONITOR);
         File f2 = new File(workDir, "f2");
         write(f2, "hi, i am new");
         add(f2);
-        GitPullResult result = client.pull(otherWT.toURI().toString(), 
Arrays.asList(new String[] { "+refs/heads/*:refs/remotes/origin/*" }), 
"origin/master", NULL_PROGRESS_MONITOR);
+        GitPullResult result = client.pull(otherWT.toURI().toString(), 
Arrays.asList(new String[]{"+refs/heads/*:refs/remotes/origin/*"}), "origin/" + 
Constants.DEFAULT_BRANCH, NULL_PROGRESS_MONITOR);
         assertEquals(MergeStatus.FAST_FORWARD, 
result.getMergeResult().getMergeStatus());
-        assertStatus(client.getStatus(new File[] { f2 }, 
NULL_PROGRESS_MONITOR), workDir, f2, true, Status.STATUS_MODIFIED, 
Status.STATUS_NORMAL, Status.STATUS_MODIFIED, false);
+        assertStatus(client.getStatus(new File[]{f2}, NULL_PROGRESS_MONITOR), 
workDir, f2, true, Status.STATUS_MODIFIED, Status.STATUS_NORMAL, 
Status.STATUS_MODIFIED, false);
     }
 
-    public void testPullCommitMessages () throws Exception {
+    public void testPullCommitMessages() throws Exception {
         GitClient client = getClient(workDir);
-        client.pull(otherWT.toURI().toString(), Arrays.asList(new String[] { 
"+refs/heads/*:refs/remotes/origin/*" }), "origin/master", 
NULL_PROGRESS_MONITOR);
+        client.pull(otherWT.toURI().toString(), Arrays.asList(new 
String[]{"+refs/heads/*:refs/remotes/origin/*"}), "origin/" + 
Constants.DEFAULT_BRANCH, NULL_PROGRESS_MONITOR);
         File f = new File(workDir, "localFile");
-        
+
         makeLocalChange(f, "1");
-        makeRemoteChange("master");
-        GitPullResult result = client.pull(otherWT.toURI().toString(), 
Arrays.asList(new String[] { "+refs/heads/*:refs/remotes/origin/*" }), 
"origin/master", NULL_PROGRESS_MONITOR);
+        makeRemoteChange(Constants.DEFAULT_BRANCH);
+        GitPullResult result = client.pull(otherWT.toURI().toString(), 
Arrays.asList(new String[]{"+refs/heads/*:refs/remotes/origin/*"}), "origin/" + 
Constants.DEFAULT_BRANCH, NULL_PROGRESS_MONITOR);
         assertEquals(GitMergeResult.MergeStatus.MERGED, 
result.getMergeResult().getMergeStatus());
-        assertEquals("Merge branch 'master' of " + new 
URIish(otherWT.toURI().toString()).toString(), 
client.log(result.getMergeResult().getNewHead(), 
NULL_PROGRESS_MONITOR).getFullMessage());
-        
+        assertEquals("Merge branch '" + Constants.DEFAULT_BRANCH + "' of " + 
new URIish(otherWT.toURI().toString()).toString() + " into " + 
Constants.DEFAULT_BRANCH, client.log(result.getMergeResult().getNewHead(), 
NULL_PROGRESS_MONITOR).getFullMessage());
+
         makeLocalChange(f, "2");
-        makeRemoteChange("master", "2");
-        result = client.pull("origin", Arrays.asList(new String[] { 
"+refs/heads/*:refs/remotes/origin/*" }), "origin/master", 
NULL_PROGRESS_MONITOR);
+        makeRemoteChange(Constants.DEFAULT_BRANCH, "2");
+        result = client.pull("origin", Arrays.asList(new 
String[]{"+refs/heads/*:refs/remotes/origin/*"}), "origin/" + 
Constants.DEFAULT_BRANCH, NULL_PROGRESS_MONITOR);
         assertEquals(GitMergeResult.MergeStatus.MERGED, 
result.getMergeResult().getMergeStatus());
-        assertEquals("Merge branch 'master' of " + new 
URIish(otherWT.toURI().toString()).toString(), 
client.log(result.getMergeResult().getNewHead(), 
NULL_PROGRESS_MONITOR).getFullMessage());

Review Comment:
   into added



-- 
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