summaryrefslogtreecommitdiffstats
path: root/services/repository/branch.go
diff options
context:
space:
mode:
authorYarden Shoham <git@yardenshoham.com>2023-05-14 00:59:01 +0300
committerGitHub <noreply@github.com>2023-05-13 21:59:01 +0000
commit4810fe55e3e73edb962052df46bef125eb1817b3 (patch)
treef5f842d1d961a831f0d5daefb8b8e5f68e574115 /services/repository/branch.go
parent68081c4721b9aeabe368f3eaeb8a4922c15d6918 (diff)
downloadgitea-4810fe55e3e73edb962052df46bef125eb1817b3.tar.gz
gitea-4810fe55e3e73edb962052df46bef125eb1817b3.zip
Add status indicator on main home screen for each repo (#24638)
It will show the calculated commit status state of the latest commit on the default branch for each repository in the dashboard repo list - Closes #15620 # Before ![image](https://github.com/go-gitea/gitea/assets/20454870/aa1326c7-43c0-458a-a798-3102c766bcf9) # After ![image](https://github.com/go-gitea/gitea/assets/20454870/8658cc03-2224-442a-b1c8-bf64126e4575) --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: delvh <dev.lh@web.de> Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'services/repository/branch.go')
-rw-r--r--services/repository/branch.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/services/repository/branch.go b/services/repository/branch.go
index a085026ae1..cafad34cef 100644
--- a/services/repository/branch.go
+++ b/services/repository/branch.go
@@ -53,6 +53,10 @@ func GetBranches(ctx context.Context, repo *repo_model.Repository, skip, limit i
return git.GetBranchesByPath(ctx, repo.RepoPath(), skip, limit)
}
+func GetBranchCommitID(ctx context.Context, repo *repo_model.Repository, branch string) (string, error) {
+ return git.GetBranchCommitID(ctx, repo.RepoPath(), branch)
+}
+
// checkBranchName validates branch name with existing repository branches
func checkBranchName(ctx context.Context, repo *repo_model.Repository, name string) error {
_, err := git.WalkReferences(ctx, repo.RepoPath(), func(_, refName string) error {