@@ -44,7 +44,7 @@ describe("getFileChanges", () => {
4444 await fixture . writeFile ( "ignored/file.txt" , "This file should be ignored" ) ;
4545 await fixture . writeFile ( ".env" , "This file should be ignored" ) ;
4646
47- const result = await getFileChanges ( fixture . path , fixture . path , "HEAD" ) ;
47+ const result = await getFileChanges ( fixture . path , "HEAD" ) ;
4848 expect ( result ) . toEqual ( {
4949 additions : [
5050 {
@@ -75,11 +75,7 @@ describe("getFileChanges", () => {
7575 } ) ;
7676 await fixture . writeFile ( "b.txt" , "This is a new file!" ) ;
7777
78- const result = await getFileChanges (
79- fixture . path ,
80- fixture . path ,
81- "refs/heads/new-branch" ,
82- ) ;
78+ const result = await getFileChanges ( fixture . path , "refs/heads/new-branch" ) ;
8379 expect ( result ) . toEqual ( {
8480 additions : [
8581 {
@@ -102,11 +98,7 @@ describe("getFileChanges", () => {
10298 } ) ;
10399 await fixture . writeFile ( "b.txt" , "This is a new file!" ) ;
104100
105- const result = await getFileChanges (
106- fixture . path ,
107- fixture . path ,
108- "refs/tags/v1.0.0" ,
109- ) ;
101+ const result = await getFileChanges ( fixture . path , "refs/tags/v1.0.0" ) ;
110102 expect ( result ) . toEqual ( {
111103 additions : [
112104 {
@@ -132,7 +124,7 @@ describe("getFileChanges", () => {
132124
133125 await fixture . writeFile ( "b.txt" , "This is a new file!" ) ;
134126
135- const result = await getFileChanges ( fixture . path , fixture . path , commitSha ) ;
127+ const result = await getFileChanges ( fixture . path , commitSha ) ;
136128 expect ( result ) . toEqual ( {
137129 additions : [
138130 {
@@ -157,7 +149,6 @@ describe("getFileChanges", () => {
157149 await fixture . writeFile ( "nested/bar.txt" , "This is a new file!" ) ;
158150
159151 const result = await getFileChanges (
160- fixture . path ,
161152 fixture . path ,
162153 "HEAD" ,
163154 // Only include top-level files
@@ -174,34 +165,6 @@ describe("getFileChanges", () => {
174165 } ) ;
175166 } ) ;
176167
177- it ( "should filter files when running in a repository sub-directory" , async ( ) => {
178- await using fixture = await createFixture ( {
179- "foo.txt" : "Hello, world!" ,
180- "nested/foo.txt" : "Hello, world!" ,
181- } ) ;
182- await setupGit ( fixture . path ) ;
183-
184- await fixture . rm ( "foo.txt" ) ;
185- await fixture . rm ( "nested/foo.txt" ) ;
186- await fixture . writeFile ( "bar.txt" , "This is a new file!" ) ;
187- await fixture . writeFile ( "nested/bar.txt" , "This is a new file!" ) ;
188-
189- const result = await getFileChanges (
190- path . join ( fixture . path , "nested" ) ,
191- fixture . path ,
192- "HEAD" ,
193- ) ;
194- expect ( result ) . toEqual ( {
195- additions : [
196- {
197- path : "nested/bar.txt" ,
198- contents : await fixture . readFile ( "nested/bar.txt" , "base64" ) ,
199- } ,
200- ] ,
201- deletions : [ { path : "nested/foo.txt" } ] ,
202- } ) ;
203- } ) ;
204-
205168 it ( "should allow existing symlinks" , async ( ) => {
206169 await using fixture = await createFixture ( {
207170 "foo.txt" : "Hello, world!" ,
@@ -220,7 +183,7 @@ describe("getFileChanges", () => {
220183 } ) ;
221184
222185 // Since we committed, HEAD points to the last commit and there's no change since then
223- const result = await getFileChanges ( fixture . path , fixture . path , "HEAD" ) ;
186+ const result = await getFileChanges ( fixture . path , "HEAD" ) ;
224187 expect ( result ) . toEqual ( { additions : [ ] , deletions : [ ] } ) ;
225188
226189 await fixture . rm ( "some-dir/nested" ) ;
@@ -230,9 +193,7 @@ describe("getFileChanges", () => {
230193 ) ;
231194
232195 // We made symlink changes since the last commit, so this should error now
233- await expect (
234- getFileChanges ( fixture . path , fixture . path , "HEAD" ) ,
235- ) . rejects . toThrow (
196+ await expect ( getFileChanges ( fixture . path , "HEAD" ) ) . rejects . toThrow (
236197 "Unexpected symlink at some-dir/nested, GitHub API only supports files and directories. You may need to add this file to .gitignore" ,
237198 ) ;
238199 } ) ;
@@ -255,7 +216,7 @@ describe("getFileChanges", () => {
255216 fixture . getPath ( "some-dir/nested" ) ,
256217 ) ;
257218
258- const result = await getFileChanges ( fixture . path , fixture . path , "HEAD" ) ;
219+ const result = await getFileChanges ( fixture . path , "HEAD" ) ;
259220 expect ( result ) . toEqual ( { additions : [ ] , deletions : [ ] } ) ;
260221 } ) ;
261222
@@ -269,9 +230,7 @@ describe("getFileChanges", () => {
269230 fixture . getPath ( "some-dir/nested" ) ,
270231 ) ;
271232
272- await expect (
273- getFileChanges ( fixture . path , fixture . path , "HEAD" ) ,
274- ) . rejects . toThrow (
233+ await expect ( getFileChanges ( fixture . path , "HEAD" ) ) . rejects . toThrow (
275234 "Unexpected symlink at some-dir/nested, GitHub API only supports files and directories. You may need to add this file to .gitignore" ,
276235 ) ;
277236 } ) ;
@@ -288,9 +247,7 @@ describe("getFileChanges", () => {
288247 fixture . getPath ( "some-dir/nested" ) ,
289248 ) ;
290249
291- await expect (
292- getFileChanges ( fixture . path , fixture . path , "HEAD" ) ,
293- ) . rejects . toThrow (
250+ await expect ( getFileChanges ( fixture . path , "HEAD" ) ) . rejects . toThrow (
294251 "Unexpected symlink at some-dir/nested, GitHub API only supports files and directories. You may need to add this file to .gitignore" ,
295252 ) ;
296253 } ) ;
@@ -302,9 +259,7 @@ describe("getFileChanges", () => {
302259 await fixture . writeFile ( "executable-file.sh" , "#!/bin/bash\necho hello" ) ;
303260 await fs . chmod ( fixture . getPath ( "executable-file.sh" ) , 0o755 ) ;
304261
305- await expect (
306- getFileChanges ( fixture . path , fixture . path , "HEAD" ) ,
307- ) . rejects . toThrow (
262+ await expect ( getFileChanges ( fixture . path , "HEAD" ) ) . rejects . toThrow (
308263 "Unexpected executable file at executable-file.sh, GitHub API only supports non-executable files and directories. You may need to add this file to .gitignore" ,
309264 ) ;
310265 } ) ;
0 commit comments