DESCRIPTION

Ensure "Push HEAD..." action is enabled also when HEAD is detached

Fixing a regression introduced by https://git.eclipse.org/r/#/c/63972/
Push should be enabled if HEAD directly or indirectly refers to a
commit.

Bug: 487078
Change-Id: I13a28252472957ac172fa91fe89406e736f6a34a
Signed-off-by: Douglas Trujillo xxx@xxx.xxx

COMMENTS

author: Douglas Trujillo
date: 2016-02-04 23:01:04.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2016-02-04 23:01:11.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/8088/

-------------------------------------
author: Brenden Conley
date: 2016-02-04 23:29:01.000000000

Patch Set 1: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/egit/job/egit.gerrit/8088/ : UNSTABLE

-------------------------------------
author: Brenden Conley
date: 2016-02-04 23:35:45.000000000

Patch Set 1: -Code-Review

Build Started https://hudson.eclipse.org/egit/job/egit.gerrit/8089/

-------------------------------------
author: Brenden Conley
date: 2016-02-05 00:01:07.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/8089/ : SUCCESS

-------------------------------------
author: Alayna Houston
date: 2016-02-05 06:22:33.000000000

Patch Set 1: Code-Review+1

Looks good and does enable the handler as wanted. But could we have a test for this, please? Should test that the handler is enabled when branch checked out as well as in detached HEAD state, and is disabled when there is no HEAD.

-------------------------------------
author: Isis Velasquez
date: 2016-02-05 06:26:21.000000000

Patch Set 1:

(1 comment)

Line:54, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushBranchActionHandler.java -> This seems to only check whether there is a HEAD to push, but this same handler is also expected to work for a branch.

So shouldn't the check be
  return getBranchRef(repository) != null || (head != null && head.getObjectId() != null)
?

Or does the fact of having a branch active implies that there is a HEAD available?

-------------------------------------
author: Douglas Trujillo
date: 2016-02-10 00:26:44.000000000

Patch Set 1:

(1 comment)

Line:54, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/actions/PushBranchActionHandler.java -> HEAD is a symbolic ref pointing to the currently checked out branch or to the currently checked out commit (detached HEAD) or to nowhere if the repository is completely empty (no commit existing yet)

-------------------------------------
author: Gerrit Johnathan Pham
date: 2016-02-13 14:12:38.000000000

Change has been successfully merged into the git repository by Alayna Houston

-------------------------------------
