mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 11:41:32 +01:00 
			
		
		
		
	models/release: Update Sha1 if tag already exists (#3331)
Since the release struct is initialized with the current `HEAD` of the current `release.Target` the commit id has to be updated if the tag commit already exists. Otherwise the linked commit on the release page will target the current `HEAD` at release time.
This commit is contained in:
		
							parent
							
								
									03ba257ad2
								
							
						
					
					
						commit
						36a63dd059
					
				| @ -81,6 +81,7 @@ func createTag(gitRepo *git.Repository, rel *Release) error { | |||||||
| 				return fmt.Errorf("GetTagCommit: %v", err) | 				return fmt.Errorf("GetTagCommit: %v", err) | ||||||
| 			} | 			} | ||||||
| 
 | 
 | ||||||
|  | 			rel.Sha1 = commit.ID.String() | ||||||
| 			rel.NumCommits, err = commit.CommitsCount() | 			rel.NumCommits, err = commit.CommitsCount() | ||||||
| 			if err != nil { | 			if err != nil { | ||||||
| 				return fmt.Errorf("CommitsCount: %v", err) | 				return fmt.Errorf("CommitsCount: %v", err) | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user