diff --git a/branches.go b/branches.go new file mode 100644 index 0000000..7d68e40 --- /dev/null +++ b/branches.go @@ -0,0 +1,14 @@ +package gitpb + +import ( + "path/filepath" +) + +// returns true if 'git pull' will work +func (repo *Repo) IsBranchRemote(branchname string) bool { + if repo.Exists(filepath.Join(".git/refs/remotes/origin", branchname)) { + // todo: actually use .git/config + return true + } + return false +}