aboutsummaryrefslogtreecommitdiff
path: root/package_git.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2018-09-14 04:24:57 +0700
committerShulhan <ms@kilabit.info>2018-09-14 04:24:57 +0700
commitaa8dd3bf7a75e5ae21b8df077edc09804f4f52bb (patch)
tree9270d5ce600b9569c177c36121c26038b8fb664e /package_git.go
parent13cba9aa5e2566d030cf6e8a6c9c9c2855f15fe5 (diff)
downloadbeku-aa8dd3bf7a75e5ae21b8df077edc09804f4f52bb.tar.xz
Get and save package remote branch in database
Some package does not have "master" branch. This will minimize parsing and filter operation to get default branch before checking out revision.
Diffstat (limited to 'package_git.go')
-rw-r--r--package_git.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/package_git.go b/package_git.go
index 12c91c2..b094b1c 100644
--- a/package_git.go
+++ b/package_git.go
@@ -58,7 +58,8 @@ func (pkg *Package) gitInstall() (err error) {
}
if pkg.isTag {
- err = git.CheckoutRevision(pkg.FullPath, "", "", pkg.Version)
+ err = git.CheckoutRevision(pkg.FullPath, pkg.RemoteName,
+ pkg.RemoteBranch, pkg.Version)
if err != nil {
err = fmt.Errorf("gitInstall: %s", err)
return
@@ -74,6 +75,7 @@ func (pkg *Package) gitInstall() (err error) {
func (pkg *Package) gitScan() (err error) {
pkg.Version, err = git.LatestVersion(pkg.FullPath)
if err != nil {
+ err = fmt.Errorf("gitScan: %s", err)
return
}
@@ -144,7 +146,8 @@ func (pkg *Package) gitUpdate(newPkg *Package) (err error) {
return
}
- err = git.CheckoutRevision(pkg.FullPath, "", "", newPkg.Version)
+ err = git.CheckoutRevision(pkg.FullPath, pkg.RemoteName,
+ pkg.RemoteBranch, newPkg.Version)
if err != nil {
err = fmt.Errorf("gitUpdate: %s", err)
}