mirror of
https://github.com/rocky-linux/srpmproc.git
synced 2024-12-04 18:36:26 +00:00
Ensure json is returned even when there's no changes
This commit is contained in:
parent
7c1d85b963
commit
ab57fbe33b
@ -666,6 +666,11 @@ func ProcessRPM(pd *data.ProcessData) (*srpmprocpb.ProcessResponse, error) {
|
||||
if !pd.ModuleMode {
|
||||
if status.IsClean() {
|
||||
pd.Log.Printf("No changes detected. Our downstream is up to date.")
|
||||
head, err := repo.Head()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting HEAD: %v", err)
|
||||
}
|
||||
latestHashForBranch[md.PushBranch] = head.Hash().String()
|
||||
continue
|
||||
}
|
||||
}
|
||||
@ -1002,13 +1007,18 @@ func processRPMTagless(pd *data.ProcessData) (*srpmprocpb.ProcessResponse, error
|
||||
|
||||
err = w.AddWithOptions(&git.AddOptions{All: true})
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error adding SOURCES/ , SPECS/ or .metadata file to commit list.")
|
||||
return nil, fmt.Errorf("error adding SOURCES/ , SPECS/ or .metadata file to commit list")
|
||||
}
|
||||
|
||||
status, err := w.Status()
|
||||
status, _ := w.Status()
|
||||
if !pd.ModuleMode {
|
||||
if status.IsClean() {
|
||||
pd.Log.Printf("No changes detected. Our downstream is up to date.")
|
||||
head, err := pushRepo.Head()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error getting HEAD: %v", err)
|
||||
}
|
||||
latestHashForBranch[md.PushBranch] = head.Hash().String()
|
||||
continue
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user