-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix last commit API with empty repository #170
Conversation
MR Evaluation:This feature is still under test, evaluation are given by AI and might be inaccurate. After evaluation, the code changes in the Merge Request get score: 88-90. Analysis for the evaluation score:
TipsCodeReview Commands (invoked as MR or PR comments)
CodeReview Discussion ChatThere are 2 ways to chat with Starship CodeReview:
Note: Be mindful of the bot's finite context window. CodeReview Documentation and Community
About Us:Visit the OpenCSG StarShip website for the Dashboard and detailed information on CodeReview, CodeGen, and other StarShip modules. |
The TipsCodeReview Commands (invoked as MR or PR comments)
CodeReview Discussion ChatThere are 2 ways to chat with Starship CodeReview:
Note: Be mindful of the bot's finite context window. CodeReview Documentation and Community
|
Related to issue OpenCSGs/csghub#768
last_commit
API in an empty repository will case a panic.MR Summary:
The summary is added by @codegpt.
The Merge Request addresses a bug related to the
last_commit
API call on an empty repository, which previously caused a panic. The fix involves ensuring the API handles empty repositories gracefully without crashing. Key updates include:GetRepoLastCommit
function incommit.go
to check if the response and the commit object are not nil before proceeding.SDKModelInfo
function inmodel.go
to handle cases where the last commit might be nil, preventing potential null pointer exceptions by introducing a check before assigning the commit ID.