diff options
| -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 { |
