Skip to content

Commit eac86d2

Browse files
committed
fixing up length check, fixing AGENTS.md squash command
1 parent ac7a9e6 commit eac86d2

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Before merging a PR created by the GitHub Copilot coding agent, you will need to
114114
One simple way to do this is the following:
115115

116116
1. Check out the coding agent's feature branch on your local machine
117-
2. Run this command from the root of the repository: `git reset --soft $(git merge-base --fork-point main HEAD)`
117+
2. Run this command from the root of the repository: `git reset --soft $(git merge-base main HEAD)`
118118
3. Commit and force push the changes
119119

120120
The three steps above will essentially allow you to collapse all of the coding agent's commits into one commit on your machine, signed by you and verifiable by GitHub. You will need to force push to the coding agent's branch to remove all of its unverified commits.

src/stable/lib/did_file/visitor/visit/service.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,16 @@ function getQueryAndUpdateMethods(
9898
);
9999
}
100100

101-
function createCanisterParamsString(initMethodCandidString: string[]): string {
102-
const parts = initMethodCandidString[0].split('->');
101+
function createCanisterParamsString(
102+
initAndPostUpgradeMethodCandidString: string[]
103+
): string {
104+
if (initAndPostUpgradeMethodCandidString.length !== 1) {
105+
throw new Error(
106+
'Expected exactly one init or post upgrade candid string'
107+
);
108+
}
109+
110+
const parts = initAndPostUpgradeMethodCandidString[0].split('->');
103111
if (parts.length >= 2) {
104112
return parts.slice(0, -1).join('->').trim();
105113
}

0 commit comments

Comments
 (0)