Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[JENKINS-40834] Should implement for 2.6.x branch but...
- Seems like the JGit Impl is not actually making the remote's HEAD available.
- Loading branch information
Showing
3 changed files
with
182 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
src/main/java/jenkins/plugins/git/GitRemoteHeadRefAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package jenkins.plugins.git; | ||
|
||
import edu.umd.cs.findbugs.annotations.NonNull; | ||
import hudson.model.InvisibleAction; | ||
import java.io.Serializable; | ||
|
||
/** | ||
* @author Stephen Connolly | ||
*/ | ||
public class GitRemoteHeadRefAction extends InvisibleAction implements Serializable { | ||
|
||
private static final long serialVersionUID = 1L; | ||
|
||
@NonNull | ||
private final String remote; | ||
@NonNull | ||
private final String name; | ||
|
||
public GitRemoteHeadRefAction(@NonNull String remote, @NonNull String name) { | ||
this.remote = remote; | ||
this.name = name; | ||
} | ||
|
||
@NonNull | ||
public String getRemote() { | ||
return remote; | ||
} | ||
|
||
@NonNull | ||
public String getName() { | ||
return name; | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) { | ||
return true; | ||
} | ||
if (o == null || getClass() != o.getClass()) { | ||
return false; | ||
} | ||
|
||
GitRemoteHeadRefAction that = (GitRemoteHeadRefAction) o; | ||
|
||
if (!remote.equals(that.remote)) { | ||
return false; | ||
} | ||
return name.equals(that.name); | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
int result = remote.hashCode(); | ||
result = 31 * result + name.hashCode(); | ||
return result; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "GitRemoteHeadRefAction{" + | ||
"remote='" + remote + '\'' + | ||
", name='" + name + '\'' + | ||
'}'; | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters