diff options
| author | Jeff Carr <[email protected]> | 2025-02-21 15:38:18 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-02-21 15:38:18 -0600 |
| commit | 587a3debebc87abbe4bed5302f34520da403befe (patch) | |
| tree | b1b5b4c2caa111fd62979fc9d012b1a8b48d02ab /branches.go | |
| parent | 22046243699a4cad639a749410b19ce52211cda8 (diff) | |
rm old code
Diffstat (limited to 'branches.go')
| -rw-r--r-- | branches.go | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/branches.go b/branches.go index ed9bbf9..9a6e8f9 100644 --- a/branches.go +++ b/branches.go @@ -19,74 +19,6 @@ func (repo *Repo) ExistsUserBranchRemote() bool { return false } -/* -// returns true if the user branch exists -func (repo *Repo) ExistsUserBranch() bool { - if repo.GetUserBranchName() == "" { - return false - } - branchname := repo.GetUserBranchName() - if repo.Exists(filepath.Join(".git/refs/heads", branchname)) { - // todo: actually use .git/config - return true - } - return repo.IsBranchRemote(branchname) -} - -// returns true if the devel branch exists -func (repo *Repo) ExistsDevelBranch() bool { - if repo.GetDevelBranchName() == "" { - return false - } - branchname := repo.GetDevelBranchName() - if repo.Exists(filepath.Join(".git/refs/heads", branchname)) { - // todo: actually use .git/config - return true - } - return repo.IsBranchRemote(branchname) -} - -func (repo *Repo) GetBranchHash(branchname string) string { - if branchname == "" { - return "" - } - if repo.Exists(filepath.Join(".git/refs/remotes", branchname)) { - return readRefHash(filepath.Join(repo.FullPath, ".git/refs/remotes", branchname)) - } - if repo.Exists(filepath.Join(".git/refs/heads", branchname)) { - return readRefHash(filepath.Join(repo.FullPath, ".git/refs/heads", branchname)) - } - return "" -} -*/ - -/* -func (repo *Repo) GetBranchVersion(branchname string) string { - if branchname == repo.GetUserBranchName() { - return "user" - } - if branchname == repo.GetDevelBranchName() { - return "devel" - } - if branchname == repo.GetMasterBranchName() { - return "master" - } - base, branchname := filepath.Split(branchname) - if base != "" { - if branchname == repo.GetUserBranchName() { - return "remote user" - } - if branchname == repo.GetDevelBranchName() { - return "remote devel" - } - if branchname == repo.GetMasterBranchName() { - return "remote master" - } - } - return "" -} -*/ - func readRefHash(filename string) string { data, _ := os.ReadFile(filename) return string(data) |
