Issue with the judge in commit phase

I’m stuck on Stage #JM9.

did anyone face the following problem?

it seems like the judge only checks the last line of git cat-file commit and checks for the commit message and it requires it to “dooby monkey vanilla dooby horsey dooby\n” and the problem is: if I put a ‘\n’ at the end of the commit message, then the last line is an empty “” line so it doesn’t match. if I commit the newline at the end of the commit message, then the commit message won’t match the expected string.

error message when I put the \n at the end: Expected “dooby monkey vanilla dooby horsey dooby\n” as commit message, got: “”

error message when I don’t: Expected “monkey horsey monkey doo doo vanilla\n” as commit message, got: “monkey horsey monkey doo doo vanilla”

Hi @ArshiAAkhavan, it seems like you might have accidentally introduced changes that break an earlier stage #IC4 (Read a blob object).

You can use our CLI to test against previous stages by running:

codecrafters test --previous

If you’d like me to review your code, feel free to upload it to GitHub and share the link.

Closing this thread due to inactivity. If you still need assistance, feel free to reopen or start a new discussion!

1 Like

i ended up going through some huge refactors that fixed the problem in the process. thanks though!

1 Like