fix: use default HEAD as ref #1335
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes the
get_file_contentstool, as the ref is optional for the AI, but not set when a request is made to the gitlab API. It also sets the default ref toHEADfor thecreate_branchtool, this avoids making an unnecessary API request to retrieve it.Server Details
Motivation and Context
The
get_file_contentshas an optionalrefparameter for the AI tooling, but is not set properly in the API request when omitted by the AI.How Has This Been Tested?
Yeah have tested the MCP locally
Breaking Changes
No
Types of changes
Checklist
Additional context
See Repository Files API Gitlab Documentation
If you don’t know the branch name or want to use the default branch, you can use HEAD as the ref value. For example: