This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 196837 - NullPointerException at org.netbeans.libs.git.jgit.JGitMergeResult.getMergedCommits
Summary: NullPointerException at org.netbeans.libs.git.jgit.JGitMergeResult.getMergedC...
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: Git (show other bugs)
Version: 7.0
Hardware: All All
: P3 normal (vote)
Assignee: Ondrej Vrabec
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-18 09:12 UTC by Exceptions Reporter
Modified: 2011-03-19 09:43 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 177649


Attachments
stacktrace (2.70 KB, text/plain)
2011-03-18 09:12 UTC, Exceptions Reporter
Details
junit test simulating the scenario (2.09 KB, patch)
2011-03-18 12:47 UTC, Ondrej Vrabec
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Exceptions Reporter 2011-03-18 09:12:31 UTC
This issue was reported manually by sopko.
It already has 1 duplicates 


Build: NetBeans IDE Dev (Build 201103140400)
VM: Java HotSpot(TM) Client VM, 19.1-b02, Java(TM) SE Runtime Environment, 1.6.0_24-b07
OS: Windows Vista

Stacktrace: 
java.lang.NullPointerException
   at org.netbeans.libs.git.jgit.JGitMergeResult.getMergedCommits(JGitMergeResult.java:105)
   at org.netbeans.libs.git.jgit.JGitMergeResult.<init>(JGitMergeResult.java:72)
   at org.netbeans.libs.git.jgit.commands.MergeCommand.run(MergeCommand.java:92)
   at org.netbeans.libs.git.jgit.commands.GitCommand.execute(GitCommand.java:70)
   at org.netbeans.libs.git.jgit.JGitClient.merge(JGitClient.java:360)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:0)
Comment 1 Exceptions Reporter 2011-03-18 09:12:36 UTC
Created attachment 107097 [details]
stacktrace
Comment 2 Ondrej Vrabec 2011-03-18 12:47:08 UTC
Created attachment 107102 [details]
junit test simulating the scenario
Comment 3 Ondrej Vrabec 2011-03-18 12:56:52 UTC
So in short what was the scenario (i guess from the log file and ui gestures log):
1) Git -> Initialize...
2) Git -> Fetch and fetch some external repository into origin - this will create remote branches in the local repository (let's say remotes/origin/master)
3) Git -> Merge and select origin/master. The action will try to merge origin/master into HEAD.
And what goes wrong? Well, the HEAD has not yet been created, so basically you're trying to merge a branch into nothing. This scenario is however supported by jgit, thus we should not be surprised when it comes to this.

This is a very very unusual and weird scenario, i assume you tried to clone an external repository, right? Than:
1) Either instead of a Merge invoke Checkout Branch action
2) Or download the latest build, the Clone action is already implemented
Comment 4 Ondrej Vrabec 2011-03-18 13:03:57 UTC
fix: http://hg.netbeans.org/core-main/rev/31412426d730
Comment 5 sopko 2011-03-18 16:12:34 UTC
(In reply to comment #3)
> This is a very very unusual and weird scenario, i assume you tried to clone an
> external repository, right? Than:
> 1) Either instead of a Merge invoke Checkout Branch action
> 2) Or download the latest build, the Clone action is already implemented

yes, i tried to clone a repository.
As this version didn't have a clone command so I experimented a bit.

I had to reinstall git now to get latest build with clone available.
Thanks for fast fix and explanation.
Comment 6 Quality Engineering 2011-03-19 09:43:40 UTC
Integrated into 'main-golden', will be available in build *201103190400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/31412426d730
User: Ondrej Vrabec <ovrabec@netbeans.org>
Log: Issue #196837 - NullPointerException at org.netbeans.libs.git.jgit.JGitMergeResult.getMergedCommits