mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Use refStr[len("refs/heads/"):] instead of refStr[11:] and fix error
Fix #1965
This commit is contained in:
		@@ -37,7 +37,7 @@ func parsePrettyFormatLog(repo *Repository, logByts []byte) (*list.List, error)
 | 
				
			|||||||
func RefEndName(refStr string) string {
 | 
					func RefEndName(refStr string) string {
 | 
				
			||||||
	if strings.HasPrefix(refStr, "refs/heads/") {
 | 
						if strings.HasPrefix(refStr, "refs/heads/") {
 | 
				
			||||||
		// trim the "refs/heads/"
 | 
							// trim the "refs/heads/"
 | 
				
			||||||
		return return refStr[11:]
 | 
							return refStr[len("refs/heads/"):]
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	index := strings.LastIndex(refStr, "/")
 | 
						index := strings.LastIndex(refStr, "/")
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user