blob: a2389bd46ddbeaa36811111bc3bc9b4142b456e6 [file] [log] [blame]
package main
import (
. ""
// Example how to resolve a revision into its commit counterpart
func main() {
CheckArgs("<path>", "<revision>")
path := os.Args[1]
revision := os.Args[2]
// We instantiate a new repository targeting the given path (the .git folder)
r, err := git.PlainOpen(path)
// Resolve revision into a sha1 commit, only some revisions are resolved
// look at the doc to get more details
Info("git rev-parse %s", revision)
h, err := r.ResolveRevision(plumbing.Revision(revision))