Commit 7de3f164 authored by Mustafa Gezen's avatar Mustafa Gezen
Browse files

Don't delete dist-git files

parent 49a37518
......@@ -53,7 +53,7 @@ func ProcessRPM(pd *data.ProcessData) {
if pd.NoDupMode {
repo, err := git.Init(memory.NewStorage(), memfs.New())
if err != nil {
log.Fatalf("could not init git Repo: %v", err)
log.Fatalf("could not init git repo: %v", err)
}
remoteUrl := fmt.Sprintf("%s/%s/%s.git", pd.UpstreamPrefix, remotePrefix, gitlabify(md.RpmFile.Name()))
refspec := config.RefSpec("+refs/heads/*:refs/remotes/origin/*")
......@@ -230,15 +230,14 @@ func ProcessRPM(pd *data.ProcessData) {
log.Fatalf("could not write to metadata file: %v", err)
}
path := checksum
if strContains(alreadyUploadedBlobs, path) {
if strContains(alreadyUploadedBlobs, checksum) {
continue
}
if !pd.BlobStorage.Exists(path) && !pd.NoStorageUpload {
pd.BlobStorage.Write(path, sourceFileBts)
log.Printf("wrote %s to blob storage", path)
if !pd.BlobStorage.Exists(checksum) && !pd.NoStorageUpload {
pd.BlobStorage.Write(checksum, sourceFileBts)
log.Printf("wrote %s to blob storage", checksum)
}
alreadyUploadedBlobs = append(alreadyUploadedBlobs, path)
alreadyUploadedBlobs = append(alreadyUploadedBlobs, checksum)
}
_, err = w.Add(metadataFile)
......@@ -257,6 +256,10 @@ func ProcessRPM(pd *data.ProcessData) {
}
}
if pd.TmpFsMode != "" {
continue
}
pd.Importer.PostProcess(md)
// show status
......@@ -275,10 +278,6 @@ func ProcessRPM(pd *data.ProcessData) {
}
}
if pd.TmpFsMode != "" {
continue
}
var hashes []plumbing.Hash
var pushRefspecs []config.RefSpec
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment