diff options
| author | Shulhan <ms@kilabit.info> | 2018-09-15 00:37:13 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2018-09-15 00:37:13 +0700 |
| commit | 7517e896ed261567e73df10899ef95913b03f291 (patch) | |
| tree | 5259e2d2ea5bd24ddc76808fb28625f663b67341 | |
| parent | e74b4be7c675849e04d6929a2017cb08e63afd69 (diff) | |
| download | beku-7517e896ed261567e73df10899ef95913b03f291.tar.xz | |
package_git: check for empty branches when getting branch
| -rw-r--r-- | package_git.go | 2 |
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 { |
