1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-05 01:45:22 +02:00
forgejo/routers/api
Earl Warren 4c4fe595c2 chore(cleanup): fix and simplify API comparison helper (#7978)
headIsTag := headGitRepo.IsCommitExist(baseBranch)

is wrong on two counts:

- it must be assigned to commitIsTag
- it must check headBranch and not baseBranch

this is not a bug but it certainly is confusing.

Also, the logic below

 	headBranchRef := headBranch
	if headIsBranch {
		headBranchRef = headBranch
	} else if headIsTag {
		headBranchRef = headBranch
	}

can be simplified as:

 	headBranchRef := headBranch

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/7978
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: Earl Warren <contact@earl-warren.org>
Co-committed-by: Earl Warren <contact@earl-warren.org>
2025-05-28 14:44:51 +02:00
..
actions feat: move UpdateTaskByState to services 2025-04-10 08:38:28 +02:00
forgejo/v1 chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00
packages Fix some trivial problems (#34237) 2025-04-22 10:20:23 +02:00
shared feat: remove API authentication methods that uses the URL query (#7924) 2025-05-23 22:47:43 +02:00
v1 chore(cleanup): fix and simplify API comparison helper (#7978) 2025-05-28 14:44:51 +02:00