mirror of
				https://github.com/go-gitea/gitea
				synced 2025-10-31 03:18:24 +00:00 
			
		
		
		
	Backport #15432 There is a weird gotcha with GetTagCommitID that because it uses git rev-list can cause an ambiguous argument error. This PR simply makes tags use the same code as branches. Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		| @@ -47,14 +47,7 @@ func (repo *Repository) GetBranchCommitID(name string) (string, error) { | |||||||
|  |  | ||||||
| // GetTagCommitID returns last commit ID string of given tag. | // GetTagCommitID returns last commit ID string of given tag. | ||||||
| func (repo *Repository) GetTagCommitID(name string) (string, error) { | func (repo *Repository) GetTagCommitID(name string) (string, error) { | ||||||
| 	stdout, err := NewCommand("rev-list", "-n", "1", TagPrefix+name).RunInDir(repo.Path) | 	return repo.GetRefCommitID(TagPrefix + name) | ||||||
| 	if err != nil { |  | ||||||
| 		if strings.Contains(err.Error(), "unknown revision or path") { |  | ||||||
| 			return "", ErrNotExist{name, ""} |  | ||||||
| 		} |  | ||||||
| 		return "", err |  | ||||||
| 	} |  | ||||||
| 	return strings.TrimSpace(stdout), nil |  | ||||||
| } | } | ||||||
|  |  | ||||||
| func convertPGPSignatureForTag(t *object.Tag) *CommitGPGSignature { | func convertPGPSignatureForTag(t *object.Tag) *CommitGPGSignature { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user