aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2018-09-15 00:37:13 +0700
committerShulhan <ms@kilabit.info>2018-09-15 00:37:13 +0700
commit7517e896ed261567e73df10899ef95913b03f291 (patch)
tree5259e2d2ea5bd24ddc76808fb28625f663b67341
parente74b4be7c675849e04d6929a2017cb08e63afd69 (diff)
downloadbeku-7517e896ed261567e73df10899ef95913b03f291.tar.xz
package_git: check for empty branches when getting branch
-rw-r--r--package_git.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/package_git.go b/package_git.go
index b094b1c..ba538fa 100644
--- a/package_git.go
+++ b/package_git.go
@@ -118,7 +118,7 @@ func (pkg *Package) gitGetBranch() (err error) {
pkg.RemoteBranch = branches[midx]
} else if vidx >= 0 {
pkg.RemoteBranch = branches[vidx]
- } else {
+ } else if len(branches) > 0 {
pkg.RemoteBranch = branches[len(branches)-1]
}
if debug.Value >= 1 {