summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-01-28 21:04:25 -0600
committerJeff Carr <[email protected]>2025-01-29 12:22:03 -0600
commit829b6ba55f319ae7a0f7dcd415e196768c796b16 (patch)
tree0959d4974504f2a49c4d313568e7516b63cab540
parent336ab60e0195cc4e96faa36855dccab563a888ab (diff)
add IsBranchRemote()
-rw-r--r--branches.go14
1 files changed, 14 insertions, 0 deletions
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
+}