Improve clone operation failure dialog

Improves dialog showed when ls-remotes command failed by adding
additional information about failure cause and suggestions what could
solve this issue.

Bug: 336795
Change-Id: I1f6bdfd7355941a9a732be7d55d44fc76c618cb8
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Prevent listener leak in properties page

Store the listener handle provided when the listener
is added and remove the handle when the page's control
is disposed.

Change-Id: Ia4ff8a821b0a0b694115e0a4a8c9b01c26a285c9
Warn when amending a commit already on a remote tracking branch

It sometimes happens that a user amends a commit that is already pushed.
This leads to a rejected push when the user tries to push the next time.
It happens either by accident or when the user doesn't yet know about
how to use amend.

To avoid this, a warning text is now shown when the user presses amend.
It's only shown when the commit to amend is contained in any remote
tracking branch (which means the commit is no longer just local).

In the commit dialog, the warning is shown as a dialog message, the same
way the existing warnings already are.

In the staging view, a label above the commit message editor is shown
when there is a warning. It's not only used for the amend warning, but
also warnings about author and committer text, the same way as in the
commit dialog.

Bug: 379172
Change-Id: If79d3459e9d6db3e1179489ebe3b206e4f5ae6eb
Signed-off-by: Robin Stocker <robin@nibor.org>
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
[repoView] Use display from workbench when scheduling runnable

This adds more guards against the Git Repositories view
being disposed when the refresh job completes.

Bug: 378216
Change-Id: I7c26418b37dd87711660878e8149a8244ae76a69
Fire config change event when edited via preference page

The previous behavior can be seen by opening the Configuration
preference page while the Properties view is being displayed
for a repository.  Selecting Apply or OK from the preference
page does not update the Properties view.  This is because
the config used by the preference page does not propagate the
change event to the repository's listeners list.

The preference page now registers a listener on the local
config being modified and passed the event to the repository
when fired.

Change-Id: Id0d2b13139eecb382c439c4b253131107ec75470
Fix assembling JGit source bundle into EGit p2 repository

Adapting build of EGit p2 repository to the workaround in
I3192dbd00b51e6ee6596d2301050b2a6f7028e3b, also re-enable assembling the
JGit source bundle.

JGit-Dependency: I3192dbd00b51e6ee6596d2301050b2a6f7028e3b
Change-Id: I9c00208b2f5262494d527366ae2e650200a9ea23
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
GitResourceDeltaVisitor: Avoid adding null paths

This gets rid of lots of Exceptions with the following stack trace:

java.lang.NullPointerException
	at
org.eclipse.jgit.treewalk.filter.PathFilter.create(PathFilter.java:77)
	at
org.eclipse.jgit.treewalk.filter.PathFilterGroup.createFromStrings(PathFilterGroup.java:90)
	at
org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.calcIndexDiffData(IndexDiffCacheEntry.java:313)
	at
org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.access$8(IndexDiffCacheEntry.java:302)
	at
org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry$6.run(IndexDiffCacheEntry.java:262)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Change-Id: Ib5423963c61766cf2fbc13a1829e2b0e1b461e49
Fix BranchAndResetActionTest

The control was changed from a radio button to a toolbar dropdown button
without adjusting the test.

Change-Id: I9f055433393a0c2d512154fa0ca70e1a095f6a8a
Use JGit ResetCommand

This replaces the local EGit reset command logic
with calls to the JGit ResetCommand class.

Change-Id: Ie91f999eca66de2a773f6143d758364f2e0e96fc
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Remove content length checking from AddOperationTest

With JGit updates to correct how smudged index entries
are handled these tests were currently failing.

Remove the explicit length checking from AddOperationTest
but still verify added entries are present in the index.

Length checking is not necessary here since files being in
the index after the operation completes is what is being
validated and file length checking is done in lower level
JGit unit tests.

Change-Id: I7f17379df0ecd415a7f08b65962596953d05b255
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>