diff options
Diffstat (limited to 'helperPatches.go')
| -rw-r--r-- | helperPatches.go | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/helperPatches.go b/helperPatches.go index 6bfd4c1..88c301a 100644 --- a/helperPatches.go +++ b/helperPatches.go @@ -181,23 +181,20 @@ func setNewCommitHash(patch *forgepb.Patch) error { comment := cleanSubject(patch.Comment) - if patch.NewHash != "" { - return nil - } os.Chdir(repo.GetFullPath()) newhash, err := findCommitBySubject(comment) if err != nil { return log.Errorf("patch: not found hash: %s %s %s %s %v", patch.CommitHash, patch.Namespace, comment, newhash, err) } - if patch.NewHash == newhash { - // patch was already set - return nil - } - if patch.NewHash != "" { - log.Infof("patch: hash MISMATCH %s old=%s new=%s name=%s\n", patch.Namespace, patch.NewHash, newhash, comment) - return nil + + patchId, err := repo.FindPatchId(newhash) + if err != nil { + return err } + + patch.PatchId = patchId patch.NewHash = newhash + log.Info("patch: found hash:", patch.CommitHash, newhash, patch.Namespace, comment) return nil } |
