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)