Be more strict with git arguments (#7715) (#7762)

* Be more strict with git arguments
* fix-up commit test
* use bindings for branch name
This commit is contained in:
zeripath 2019-08-06 03:05:48 +01:00 committed by techknowlogick
parent c6f1825fe9
commit 65a76b7cb0
12 changed files with 41 additions and 20 deletions

View file

@ -28,7 +28,7 @@ func (repo *Repository) getTree(id SHA1) (*Tree, error) {
// GetTree find the tree object in the repository.
func (repo *Repository) GetTree(idStr string) (*Tree, error) {
if len(idStr) != 40 {
res, err := NewCommand("rev-parse", idStr).RunInDir(repo.Path)
res, err := NewCommand("rev-parse", "--verify", idStr).RunInDir(repo.Path)
if err != nil {
return nil, err
}