// Copyright 2015 The Gogs Authors. All rights reserved.// Use of this source code is governed by a MIT-style// license that can be found in the LICENSE file.packagegitfunc(repo*Repository)getTree(idsha1)(*Tree,error){treePath:=filepathFromSHA1(repo.Path,id.String())ifisFile(treePath){_,err:=NewCommand("ls-tree",id.String()).RunInDir(repo.Path)iferr!=nil{returnnil,ErrNotExist{id.String(),""}}}returnNewTree(repo,id),nil}// Find the tree object in the repository.func(repo*Repository)GetTree(idStrstring)(*Tree,error){id,err:=NewIDFromString(idStr)iferr!=nil{returnnil,err}returnrepo.getTree(id)}