···
targetBranch := branchResp
418
-
latestSourceRev := pull.Submissions[pull.LastRoundNumber()].SourceRev
418
+
latestSourceRev := pull.LatestSha()
if pull.IsStacked() && stack != nil {
422
-
latestSourceRev = top.Submissions[top.LastRoundNumber()].SourceRev
422
+
latestSourceRev = top.LatestSha()
if latestSourceRev != targetBranch.Hash {
···
// validate sourceRev if branch/fork based
if pull.IsBranchBased() || pull.IsForkBased() {
1814
-
if sourceRev == pull.Submissions[pull.LastRoundNumber()].SourceRev {
1814
+
if sourceRev == pull.LatestSha() {
s.pages.Notice(w, "resubmit-error", "This branch has not changed since the last submission.")
···
1828
-
err = db.ResubmitPull(tx, pull, patch, sourceRev)
1828
+
pull.Submissions = append(pull.Submissions, &models.PullSubmission{
1830
+
SourceRev: sourceRev,
1832
+
err = db.ResubmitPull(tx, pull)
log.Println("failed to create pull request", err)
s.pages.Notice(w, "resubmit-error", "Failed to create pull request. Try again later.")
···
2019
-
submission := np.Submissions[np.LastRoundNumber()]
2022
-
err := db.ResubmitPull(tx, op, submission.Patch, submission.SourceRev)
2024
+
err := db.ResubmitPull(tx, np)
log.Println("failed to update pull", err, op.PullId)
···
2030
-
record := op.AsRecord()
2031
-
record.Patch = submission.Patch
2032
+
record := np.AsRecord()
writes = append(writes, &comatproto.RepoApplyWrites_Input_Writes_Elem{
RepoApplyWrites_Update: &comatproto.RepoApplyWrites_Update{