mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	Deduplicate findReadmeFile() (#22177)
This code was copy-pasted at some point. Revisit it to reunify it. ~~Doing that then encouraged simplifying the types of a couple of related functions.~~ ~~As a follow-up, move two helper functions, `isReadmeFile()` and `isReadmeFileExtension()`, intimately tied to `findReadmeFile()`, in as package-private.~~ Signed-off-by: Nick Guenther <nick.guenther@polymtl.ca>
This commit is contained in:
		| @@ -101,6 +101,15 @@ func (te *TreeEntry) FollowLinks() (*TreeEntry, error) { | ||||
| 	return entry, nil | ||||
| } | ||||
|  | ||||
| // returns the subtree, or nil if this is not a tree | ||||
| func (te *TreeEntry) Tree() *Tree { | ||||
| 	t, err := te.ptree.repo.getTree(te.ID) | ||||
| 	if err != nil { | ||||
| 		return nil | ||||
| 	} | ||||
| 	return t | ||||
| } | ||||
|  | ||||
| // GetSubJumpablePathName return the full path of subdirectory jumpable ( contains only one directory ) | ||||
| func (te *TreeEntry) GetSubJumpablePathName() string { | ||||
| 	if te.IsSubModule() || !te.IsDir() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user