diff --git a/routers/web/repo/compare.go b/routers/web/repo/compare.go index 49027ea2e25..2fdc4fce89c 100644 --- a/routers/web/repo/compare.go +++ b/routers/web/repo/compare.go @@ -734,7 +734,7 @@ func ExcerptBlob(ctx *context.Context) { ctx.ServerError("GetCommit", err) return } - blob, err := commit.GetBlobByPath(ctx, ctx.Repo.GitRepo, filePath) + blob, err := commit.GetBlobByPath(ctx, gitRepo, filePath) if err != nil { ctx.ServerError("GetBlobByPath", err) return diff --git a/tests/integration/wiki_test.go b/tests/integration/wiki_test.go index 11eef67c685..1a3447bcab7 100644 --- a/tests/integration/wiki_test.go +++ b/tests/integration/wiki_test.go @@ -37,6 +37,9 @@ func TestRepoWikiPages(t *testing.T) { assert.Equal(t, expectedPagePaths[i], pagePath) }) + + req = NewRequest(t, "GET", "/user2/repo1/wiki/blob_excerpt/a5bbc0fd39a696feabed2d4cccaf05abbcaf3b02?last_left=0&last_right=0&left=2&right=2&left_hunk_size=2&right_hunk_size=2&path=Home.md&style=split&direction=up") + MakeRequest(t, req, http.StatusOK) } func testRepoWikiCloneHTTP(t *testing.T, u *url.URL) {