Skip to content

Commit e650bb0

Browse files
committed
revert changes to resource URI
1 parent 5acb47c commit e650bb0

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

pkg/github/repositories.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -540,11 +540,6 @@ func GetFileContents(getClient GetClientFn, getRawClient raw.GetRawClientFn, t t
540540

541541
var resourceURI string
542542
switch {
543-
case fileSHA != "":
544-
resourceURI, err = url.JoinPath("repo://", owner, repo, "sha", fileSHA, "contents", path)
545-
if err != nil {
546-
return nil, fmt.Errorf("failed to create resource URI: %w", err)
547-
}
548543
case sha != "":
549544
resourceURI, err = url.JoinPath("repo://", owner, repo, "sha", sha, "contents", path)
550545
if err != nil {

pkg/github/repositories_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func Test_GetFileContents(t *testing.T) {
106106
},
107107
expectError: false,
108108
expectedResult: mcp.TextResourceContents{
109-
URI: "repo://owner/repo/sha/abc123/contents/README.md",
109+
URI: "repo://owner/repo/refs/heads/main/contents/README.md",
110110
Text: "# Test Repository\n\nThis is a test repository.",
111111
MIMEType: "text/markdown",
112112
},
@@ -151,7 +151,7 @@ func Test_GetFileContents(t *testing.T) {
151151
},
152152
expectError: false,
153153
expectedResult: mcp.BlobResourceContents{
154-
URI: "repo://owner/repo/sha/def456/contents/test.png",
154+
URI: "repo://owner/repo/refs/heads/main/contents/test.png",
155155
Blob: base64.StdEncoding.EncodeToString(mockRawContent),
156156
MIMEType: "image/png",
157157
},

0 commit comments

Comments
 (0)