commit | f43fea2f60202979b52fe6fabd174a35c09a4abd | [log] [tgz] |
---|---|---|
author | Patrizio <patrizio.gelosi@amarulasolutions.com> | Fri May 17 12:09:05 2024 +0200 |
committer | Patrizio <patrizio.gelosi@amarulasolutions.com> | Thu May 23 09:41:10 2024 +0200 |
tree | 70d3a4d9bada9cb77870153b8aed56e709e5c6e6 | |
parent | 851a7899004b5fc190446a4d4d50fba02c15e17c [diff] |
Update fallback revision base to zero Changed the fallback value for the revision base to zero. The previous value of -1 causes issues, eg, when retrieving patch set diffs in stateful mode, as addressed in the next commit. Fixes: 3b49995 ("Migrate GerritClientPatchSet to direct GerritApi") Change-Id: I84bd3feb7fa2867e240071362f56751bc7e6b35f Signed-off-by: Patrizio <patrizio.gelosi@amarulasolutions.com>
diff --git a/src/main/java/com/googlesource/gerrit/plugins/chatgpt/mode/common/client/api/gerrit/GerritClientPatchSet.java b/src/main/java/com/googlesource/gerrit/plugins/chatgpt/mode/common/client/api/gerrit/GerritClientPatchSet.java index c409cc5..4e17e7e 100644 --- a/src/main/java/com/googlesource/gerrit/plugins/chatgpt/mode/common/client/api/gerrit/GerritClientPatchSet.java +++ b/src/main/java/com/googlesource/gerrit/plugins/chatgpt/mode/common/client/api/gerrit/GerritClientPatchSet.java
@@ -36,7 +36,7 @@ Optional.ofNullable(changeInfo) .map(info -> info.revisions) .map(revisions -> revisions.size() - 1) - .orElse(-1); + .orElse(0); } catch (Exception e) { log.error("Could not retrieve revisions for PatchSet with fullChangeId: {}", change.getFullChangeId(), e);