diff --git a/appview/db/pulls.go b/appview/db/pulls.go
index 037612d..6cca86c 100644
--- a/appview/db/pulls.go
+++ b/appview/db/pulls.go
@@ -122,7 +122,11 @@ func (p *Pull) LastRoundNumber() int {
return len(p.Submissions) - 1
}
-func (p *Pull) IsSameRepoBranch() bool {
+func (p *Pull) IsPatchBased() bool {
+ return p.PullSource == nil
+}
+
+func (p *Pull) IsBranchBased() bool {
if p.PullSource != nil {
if p.PullSource.RepoAt != nil {
return p.PullSource.RepoAt == &p.RepoAt
@@ -134,8 +138,14 @@ func (p *Pull) IsSameRepoBranch() bool {
return false
}
-func (p *Pull) IsPatch() bool {
- return p.PullSource == nil
+func (p *Pull) IsForkBased() bool {
+ if p.PullSource != nil {
+ if p.PullSource.RepoAt != nil {
+ // make sure repos are different
+ return p.PullSource.RepoAt != &p.RepoAt
+ }
+ }
+ return false
}
func (s PullSubmission) AsNiceDiff(targetBranch string) types.NiceDiff {
diff --git a/appview/pages/templates/fragments/pullActions.html b/appview/pages/templates/fragments/pullActions.html
index 7b1d560..54bf14e 100644
--- a/appview/pages/templates/fragments/pullActions.html
+++ b/appview/pages/templates/fragments/pullActions.html
@@ -9,7 +9,7 @@
{{ $isConflicted := and .MergeCheck (or .MergeCheck.Error .MergeCheck.IsConflicted) }}
{{ $isPullAuthor := and .LoggedInUser (eq .LoggedInUser.Did .Pull.OwnerDid) }}
{{ $isLastRound := eq $roundNumber $lastIdx }}
- {{ $isSameRepoBranch := .Pull.IsSameRepoBranch }}
+ {{ $isSameRepoBranch := .Pull.IsBranchBased }}
{{ $isUpToDate := .ResubmitCheck.No }}
@@ -42,7 +42,7 @@
{{ $disabled = "disabled" }}
{{ end }}