Add gitweb.linkDrafts to control if gitweb links are shown on drafts
If gitweb is hosted on a second server and only public references are replicated, links to draft patch sets in the panel don't go anywhere useful. Default behavior remains the same, to provide links on all patch sets, regardless of draft status. Change-Id: Ia26f08b4fd4e480a89b84ff5602603c3fcc8eee6
This commit is contained in:
@@ -35,6 +35,16 @@ public class GitwebLink {
|
||||
type = link.type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Can we link to a patch set if it's a draft
|
||||
*
|
||||
* @param ps Patch set to check draft status
|
||||
* @return true if it's not a draft, or we can link to drafts
|
||||
*/
|
||||
public boolean canLink(final PatchSet ps) {
|
||||
return !ps.isDraft() || type.getLinkDrafts();
|
||||
}
|
||||
|
||||
public String getLinkName() {
|
||||
return "(" + type.getLinkName() + ")";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user