Skip to content

REST api "repos/{owner}/{repo}/compare/{basehead}" cannot compare between commits #31838

Closed
@Zarklord

Description

@Zarklord

Description

The documentation for that specific rest API describes the {basehead} as the following:

compare two branches or commits

but, in reality, it's only capable of comparing between two branches/tags, because the source code explicitly checks if the base is a branch or a tag and if the head is a branch of a tag which prevents you from comparing commits like the api's description implies you can, and that you can compare between commits on the web interface

(also as an aside, but the expected format of {basehead} isn't stated anywhere, nor is there an example for you to infer it)

Gitea Version

1.22.1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

N/A

Screenshots

image

Git Version

N/A

Operating System

ubuntu 22.04

How are you running Gitea?

docker gitea/gitea:1.22.1@sha256:1b9dcae47e821b8dd75c1e48d13677c428624d02e683badb461e4947300e7d19

Database

PostgreSQL

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions