summaryrefslogtreecommitdiffstats
path: root/modules/git/repo_tree.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2019-08-05 21:39:39 +0100
committerGitHub <noreply@github.com>2019-08-05 21:39:39 +0100
commit7ad67109d732bd560c8da0356aa555be467d786c (patch)
tree7c7a35761b01e2eec6a823f0caf40748c3b7f327 /modules/git/repo_tree.go
parent1d8915ad5d9889c02dd98ab2c2f29aa8f5ee4dfa (diff)
downloadgitea-7ad67109d732bd560c8da0356aa555be467d786c.tar.gz
gitea-7ad67109d732bd560c8da0356aa555be467d786c.zip
Be more strict with git arguments (#7715)
* Be more strict with git arguments * fix-up commit test * use bindings for branch name
Diffstat (limited to 'modules/git/repo_tree.go')
-rw-r--r--modules/git/repo_tree.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/git/repo_tree.go b/modules/git/repo_tree.go
index 4b9e61f264..b31e4330cd 100644
--- a/modules/git/repo_tree.go
+++ b/modules/git/repo_tree.go
@@ -26,7 +26,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
}