[PR #133] [MERGED] Refactor branch list using src-d/go-git and add GetRefs function #137

Closed
opened 2026-02-16 10:24:13 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-gitea/git/pull/133
Author: @lafriks
Created: 11/10/2018
Status: Merged
Merged: 11/15/2018
Merged by: @jonasfranz

Base: masterHead: feat/refs_gogit


📝 Commits (6)

  • d9cf899 Refactor branch list using src-d/go-git and add GetRefs function
  • a8d1899 Fix copyright
  • 6cb0e76 Fix to reuse ObjectType
  • 93ce354 Add function to filter refs by prefix
  • 5cfc365 Fix import order
  • 0b52498 Optimize if structure

📊 Changes

456 files changed (+106076 additions, -749 deletions)

View changed files

📝 Gopkg.lock (+230 -7)
📝 Gopkg.toml (+4 -0)
ref.go (+18 -0)
📝 repo_branch.go (+16 -5)
repo_branch_test.go (+39 -0)
📝 repo_commit_test.go (+1 -1)
repo_ref.go (+51 -0)
repo_ref_test.go (+49 -0)
📝 vendor/github.com/Unknwon/com/dir.go (+49 -4)
📝 vendor/github.com/Unknwon/com/math.go (+2 -2)
📝 vendor/github.com/davecgh/go-spew/LICENSE (+2 -2)
📝 vendor/github.com/davecgh/go-spew/spew/bypass.go (+91 -98)
📝 vendor/github.com/davecgh/go-spew/spew/bypasssafe.go (+2 -2)
📝 vendor/github.com/davecgh/go-spew/spew/common.go (+2 -2)
📝 vendor/github.com/davecgh/go-spew/spew/config.go (+10 -1)
📝 vendor/github.com/davecgh/go-spew/spew/doc.go (+10 -1)
📝 vendor/github.com/davecgh/go-spew/spew/dump.go (+9 -9)
📝 vendor/github.com/davecgh/go-spew/spew/format.go (+3 -3)
📝 vendor/github.com/davecgh/go-spew/spew/spew.go (+1 -1)
vendor/github.com/emirpasic/gods/LICENSE (+41 -0)

...and 80 more files

📄 Description

GetRefs will be needed to implement Refs API

Add src-d/go-git dependency and refactored GetBranches to use this lib.

Old using git command:
BenchmarkRepository_GetBranches-4           1000           1505930 ns/op
New using src-d/go-git:
BenchmarkRepository_GetBranches-4          10000            150774 ns/op

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-gitea/git/pull/133 **Author:** [@lafriks](https://github.com/lafriks) **Created:** 11/10/2018 **Status:** ✅ Merged **Merged:** 11/15/2018 **Merged by:** [@jonasfranz](https://github.com/jonasfranz) **Base:** `master` ← **Head:** `feat/refs_gogit` --- ### 📝 Commits (6) - [`d9cf899`](https://github.com/go-gitea/git/commit/d9cf899aa2997f510d40a2c46b04f57a3d5f90f0) Refactor branch list using src-d/go-git and add GetRefs function - [`a8d1899`](https://github.com/go-gitea/git/commit/a8d1899ab5bc879ff16f7a8f930b946979bd8c7b) Fix copyright - [`6cb0e76`](https://github.com/go-gitea/git/commit/6cb0e763cfdd5232175bf589f00d4e161a34d620) Fix to reuse ObjectType - [`93ce354`](https://github.com/go-gitea/git/commit/93ce35423fa8c1fb85e13b8fc3d9228395c2e96a) Add function to filter refs by prefix - [`5cfc365`](https://github.com/go-gitea/git/commit/5cfc365e2c9f0429a6be2972375933ef5e91a432) Fix import order - [`0b52498`](https://github.com/go-gitea/git/commit/0b52498ba8a4229c07a9b85fce47d157b536a1cc) Optimize if structure ### 📊 Changes **456 files changed** (+106076 additions, -749 deletions) <details> <summary>View changed files</summary> 📝 `Gopkg.lock` (+230 -7) 📝 `Gopkg.toml` (+4 -0) ➕ `ref.go` (+18 -0) 📝 `repo_branch.go` (+16 -5) ➕ `repo_branch_test.go` (+39 -0) 📝 `repo_commit_test.go` (+1 -1) ➕ `repo_ref.go` (+51 -0) ➕ `repo_ref_test.go` (+49 -0) 📝 `vendor/github.com/Unknwon/com/dir.go` (+49 -4) 📝 `vendor/github.com/Unknwon/com/math.go` (+2 -2) 📝 `vendor/github.com/davecgh/go-spew/LICENSE` (+2 -2) 📝 `vendor/github.com/davecgh/go-spew/spew/bypass.go` (+91 -98) 📝 `vendor/github.com/davecgh/go-spew/spew/bypasssafe.go` (+2 -2) 📝 `vendor/github.com/davecgh/go-spew/spew/common.go` (+2 -2) 📝 `vendor/github.com/davecgh/go-spew/spew/config.go` (+10 -1) 📝 `vendor/github.com/davecgh/go-spew/spew/doc.go` (+10 -1) 📝 `vendor/github.com/davecgh/go-spew/spew/dump.go` (+9 -9) 📝 `vendor/github.com/davecgh/go-spew/spew/format.go` (+3 -3) 📝 `vendor/github.com/davecgh/go-spew/spew/spew.go` (+1 -1) ➕ `vendor/github.com/emirpasic/gods/LICENSE` (+41 -0) _...and 80 more files_ </details> ### 📄 Description GetRefs will be needed to implement Refs API Add src-d/go-git dependency and refactored GetBranches to use this lib. ``` Old using git command: BenchmarkRepository_GetBranches-4 1000 1505930 ns/op New using src-d/go-git: BenchmarkRepository_GetBranches-4 10000 150774 ns/op ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 10:24:13 -05:00
yindo closed this issue 2026-02-16 10:24:13 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: go-gitea/git#137