improvement

This commit is contained in:
Lunny Xiao committed 2026-01-02 18:50:54 -08:00
1 parent 5bf1c5010e
commit 68bb75168a
8 files changed
+50 -88

No files matched your search

-12
View File
@@ -20,15 +20,3 @@ func MergeBase(ctx context.Context, repo Repository, baseCommitID, headCommitID
}
return strings.TrimSpace(mergeBase), nil
}
// MergeBaseFromRemote checks and returns merge base of two commits from different repositories.
func MergeBaseFromRemote(ctx context.Context, baseRepo, headRepo Repository, baseCommitID, headCommitID string) (string, error) {
// fetch head commit id into the current repository if the repositories are different
if baseRepo.RelativePath() != headRepo.RelativePath() {
if err := FetchRemoteCommit(ctx, baseRepo, headRepo, headCommitID); err != nil {
return "", fmt.Errorf("FetchRemoteCommit: %w", err)
}
}
return MergeBase(ctx, baseRepo, baseCommitID, headCommitID)
}