1
0
Fork 0
mirror of https://codeberg.org/forgejo/forgejo.git synced 2025-08-05 18:05:19 +02:00
forgejo/routers
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
..
api chore(cleanup): fix and simplify API comparison helper (#7978) 2025-05-28 14:44:51 +02:00
common feat: use XORM EngineGroup instead of single Engine connection (#7212) 2025-03-30 11:34:02 +00:00
install chore: use sharp to generate images (#7512) 2025-04-11 15:12:50 +00:00
private fix(sec): only degrade permission check for git push 2025-05-02 06:56:30 +02:00
utils [PORT] drop utils.IsExternalURL (and expand IsRiskyRedirectURL tests) (#3167) 2024-04-15 13:03:08 +00:00
web chore(ui): clean up hashbox CSS, small design changes (#7822) 2025-05-25 12:51:27 +02:00
init.go chore: branding import path (#7337) 2025-03-27 19:40:14 +00:00