mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 08:34:30 +01:00 
			
		
		
		
	fix artifact merging chunks path with correct slash on Windows (#26400)
From Discord https://discord.com/channels/322538954119184384/1069795723178160168/1136719889684500480 Artifact chunks merging is break on Windows. ``` Gitea Log: 2023/08/03 20:51:15 ...actions/artifacts.go:271:comfirmUploadArtifact() [E] Error merge chunks: parse content range error: input does not match format ``` Artifact uses wrong slash to parse saved chunks path.
This commit is contained in:
		
							parent
							
								
									e6f8e9318b
								
							
						
					
					
						commit
						ad69f7175a
					
				@ -8,6 +8,7 @@ import (
 | 
			
		||||
	"encoding/base64"
 | 
			
		||||
	"fmt"
 | 
			
		||||
	"io"
 | 
			
		||||
	"path/filepath"
 | 
			
		||||
	"sort"
 | 
			
		||||
	"time"
 | 
			
		||||
 | 
			
		||||
@ -67,7 +68,7 @@ func listChunksByRunID(st storage.ObjectStorage, runID int64) (map[int64][]*chun
 | 
			
		||||
	var chunks []*chunkFileItem
 | 
			
		||||
	if err := st.IterateObjects(storageDir, func(path string, obj storage.Object) error {
 | 
			
		||||
		item := chunkFileItem{Path: path}
 | 
			
		||||
		if _, err := fmt.Sscanf(path, storageDir+"/%d-%d-%d.chunk", &item.ArtifactID, &item.Start, &item.End); err != nil {
 | 
			
		||||
		if _, err := fmt.Sscanf(path, filepath.Join(storageDir, "%d-%d-%d.chunk"), &item.ArtifactID, &item.Start, &item.End); err != nil {
 | 
			
		||||
			return fmt.Errorf("parse content range error: %v", err)
 | 
			
		||||
		}
 | 
			
		||||
		chunks = append(chunks, &item)
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user