aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-08-12 01:59:53 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2016-08-12 01:59:53 +0200
commit805cc777b083fee68a8834ebe1823d0b9dc6a00f (patch)
treee497602859f7e238072a31d20477db6a656f6482 /examples
parent68307cee4259c6c4fded8124af7f993f0266a545 (diff)
downloadgo-git-805cc777b083fee68a8834ebe1823d0b9dc6a00f.tar.gz
general: usage of the new Reference objects
Diffstat (limited to 'examples')
-rw-r--r--examples/latest/latest.go8
1 files changed, 2 insertions, 6 deletions
diff --git a/examples/latest/latest.go b/examples/latest/latest.go
index 9faf59f..2ccddf1 100644
--- a/examples/latest/latest.go
+++ b/examples/latest/latest.go
@@ -18,12 +18,8 @@ func main() {
panic(err)
}
- hash, err := r.Remotes[git.DefaultRemoteName].Head()
- if err != nil {
- panic(err)
- }
-
- commit, err := r.Commit(hash)
+ head := r.Remotes[git.DefaultRemoteName].Head()
+ commit, err := r.Commit(head.Hash())
if err != nil {
panic(err)
}