aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-04-25 08:57:48 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-04-25 08:57:48 +0200
commit74b8b53b28d444542edc77e0beec19bbab8e8037 (patch)
treed311444af46cc4b24e48ce5f8b86da99f28585c1 /remote.go
parenta84f6e9637d5fac2fb5a6164b633ed07c9a0a8e6 (diff)
downloadgo-git-74b8b53b28d444542edc77e0beec19bbab8e8037.tar.gz
remote.Head and repository.PullDefault
Diffstat (limited to 'remote.go')
-rw-r--r--remote.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/remote.go b/remote.go
index 283b6b3..095faff 100644
--- a/remote.go
+++ b/remote.go
@@ -81,6 +81,11 @@ func (r *Remote) DefaultBranch() string {
return r.upInfo.Capabilities.SymbolicReference("HEAD")
}
+// Head returns the Hash of the HEAD
+func (r *Remote) Head() (core.Hash, error) {
+ return r.Ref(r.DefaultBranch())
+}
+
// Fetch returns a reader using the request
func (r *Remote) Fetch(req *common.GitUploadPackRequest) (io.ReadCloser, error) {
return r.upSrv.Fetch(req)