Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 351326 - 'Git Staging' view's actions not aware of the current repository
Summary: 'Git Staging' view's actions not aware of the current repository
Status: RESOLVED FIXED
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 1.1   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Jens Baumgart CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-06 09:02 EDT by Remy Suen CLA
Modified: 2011-07-07 04:58 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Remy Suen CLA 2011-07-06 09:02:54 EDT
If you try to click on 'Amend Previous Commit' when you have no repositories selected, you will get some exceptions.

java.lang.NullPointerException
	at org.eclipse.egit.ui.internal.commit.CommitHelper.getHeadCommit(CommitHelper.java:108)
	at org.eclipse.egit.ui.internal.commit.CommitHelper.getHeadCommitInfo(CommitHelper.java:224)
	at org.eclipse.egit.ui.internal.dialogs.CommitMessageComponent.getHeadCommitInfo(CommitMessageComponent.java:457)
	at org.eclipse.egit.ui.internal.dialogs.CommitMessageComponent.setAmendingButtonSelection(CommitMessageComponent.java:269)
	at org.eclipse.egit.ui.internal.staging.StagingView$15.run(StagingView.java:553)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4163)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)

java.lang.IllegalArgumentException: Argument cannot be null
	at org.eclipse.swt.SWT.error(SWT.java:4258)
	at org.eclipse.swt.SWT.error(SWT.java:4192)
	at org.eclipse.swt.SWT.error(SWT.java:4163)
	at org.eclipse.swt.widgets.Widget.error(Widget.java:468)
	at org.eclipse.swt.widgets.Text.setText(Text.java:1965)
	at org.eclipse.egit.ui.internal.dialogs.CommitMessageComponent.setAmendingButtonSelection(CommitMessageComponent.java:267)
	at org.eclipse.egit.ui.internal.staging.StagingView$15.run(StagingView.java:553)
	at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
	at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
	at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
	at org.eclipse.jface.action.ActionContributionItem$6.handleEvent(ActionContributionItem.java:452)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4163)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
Comment 1 Jens Baumgart CLA 2011-07-06 10:28:09 EDT
Fix proposed: http://egit.eclipse.org/r/3834
Comment 2 Matthias Sohn CLA 2011-07-07 04:58:01 EDT
merged as 9511a146bc182b62901a528ff3eec150f69859aa