From 12d9366e0178d70eca089914498f2e1d6ab745f2 Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 25 Jan 2022 17:00:03 -0800 Subject: [PATCH] operations: Allow rebase to work if patch has already been applied Recently it appears there has been an uptick of rebase failures due to "this patch has already been applied" errors. If a target branch contains changes that are already in the source branch, and a user rebases, this failure would cause the rebase to stop. We now skip these empty commits and allow the rebase to continue. This is already with squash. Relates to https://gitlab.com/gitlab-org/gitlab/-/issues/351017 Changelog: fixed --- internal/gitaly/service/operations/rebase.go | 1 + 1 file changed, 1 insertion(+) diff --git a/internal/gitaly/service/operations/rebase.go b/internal/gitaly/service/operations/rebase.go index 66d3ac360c9..f3dcc7b2a7e 100644 --- a/internal/gitaly/service/operations/rebase.go +++ b/internal/gitaly/service/operations/rebase.go @@ -64,6 +64,7 @@ func (s *Server) UserRebaseConfirmable(stream gitalypb.OperationService_UserReba Committer: committer, BranchName: string(header.Branch), UpstreamRevision: startRevision.String(), + SkipEmptyCommits: true, }) if err != nil { return stream.Send(&gitalypb.UserRebaseConfirmableResponse{ -- GitLab