mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	* Allow git.GetTree to take both commit and tree names, return full paths on entries listed through Tree.ListEntriesRecursive Signed-off-by: Filip Navara <filip.navara@gmail.com> * Fix the SHA returned on Git Tree APIs called with commit hash or symbolic name Signed-off-by: Filip Navara <filip.navara@gmail.com>
This commit is contained in:
		
				
					committed by
					
						
						techknowlogick
					
				
			
			
				
	
			
			
			
						parent
						
							a27d5d2b23
						
					
				
				
					commit
					dbb0c9658c
				
			@@ -15,9 +15,9 @@ import (
 | 
			
		||||
 | 
			
		||||
// Tree represents a flat directory listing.
 | 
			
		||||
type Tree struct {
 | 
			
		||||
	ID       SHA1
 | 
			
		||||
	CommitID SHA1
 | 
			
		||||
	repo     *Repository
 | 
			
		||||
	ID         SHA1
 | 
			
		||||
	ResolvedID SHA1
 | 
			
		||||
	repo       *Repository
 | 
			
		||||
 | 
			
		||||
	gogitTree *object.Tree
 | 
			
		||||
 | 
			
		||||
@@ -106,7 +106,7 @@ func (t *Tree) ListEntriesRecursive() (Entries, error) {
 | 
			
		||||
	seen := map[plumbing.Hash]bool{}
 | 
			
		||||
	walker := object.NewTreeWalker(t.gogitTree, true, seen)
 | 
			
		||||
	for {
 | 
			
		||||
		_, entry, err := walker.Next()
 | 
			
		||||
		fullName, entry, err := walker.Next()
 | 
			
		||||
		if err == io.EOF {
 | 
			
		||||
			break
 | 
			
		||||
		}
 | 
			
		||||
@@ -121,6 +121,7 @@ func (t *Tree) ListEntriesRecursive() (Entries, error) {
 | 
			
		||||
			ID:             entry.Hash,
 | 
			
		||||
			gogitTreeEntry: &entry,
 | 
			
		||||
			ptree:          t,
 | 
			
		||||
			fullName:       fullName,
 | 
			
		||||
		}
 | 
			
		||||
		entries = append(entries, convertedEntry)
 | 
			
		||||
	}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user