mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Fix #515
This commit is contained in:
		@@ -40,11 +40,11 @@ func (repo *Repository) GetCommitIdOfTag(tagName string) (string, error) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (repo *Repository) GetCommitOfTag(tagName string) (*Commit, error) {
 | 
			
		||||
	commitId, err := repo.GetCommitIdOfTag(tagName)
 | 
			
		||||
	tag, err := repo.GetTag(tagName)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	return repo.GetCommit(commitId)
 | 
			
		||||
	return tag.Commit()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Parse commit information from the (uncompressed) raw
 | 
			
		||||
 
 | 
			
		||||
@@ -52,6 +52,7 @@ func (repo *Repository) getTag(id sha1) (*Tag, error) {
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		return nil, errors.New(stderr)
 | 
			
		||||
	}
 | 
			
		||||
	tp = strings.TrimSpace(tp)
 | 
			
		||||
 | 
			
		||||
	// Tag is a commit.
 | 
			
		||||
	if ObjectType(tp) == COMMIT {
 | 
			
		||||
@@ -77,7 +78,6 @@ func (repo *Repository) getTag(id sha1) (*Tag, error) {
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	tag.Id = id
 | 
			
		||||
	tag.Object = id
 | 
			
		||||
	tag.repo = repo
 | 
			
		||||
 | 
			
		||||
	repo.tagCache[id] = tag
 | 
			
		||||
 
 | 
			
		||||
@@ -109,9 +109,12 @@ func (t *Tree) ListEntries(relpath string) (Entries, error) {
 | 
			
		||||
	}
 | 
			
		||||
	t.entriesParsed = true
 | 
			
		||||
 | 
			
		||||
	stdout, _, err := com.ExecCmdDirBytes(t.repo.Path,
 | 
			
		||||
	stdout, stderr, err := com.ExecCmdDirBytes(t.repo.Path,
 | 
			
		||||
		"git", "ls-tree", t.Id.String())
 | 
			
		||||
	if err != nil {
 | 
			
		||||
		if strings.Contains(err.Error(), "exit status 128") {
 | 
			
		||||
			return nil, errors.New(strings.TrimSpace(string(stderr)))
 | 
			
		||||
		}
 | 
			
		||||
		return nil, err
 | 
			
		||||
	}
 | 
			
		||||
	t.entries, err = parseTreeData(t, stdout)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user