@@ -229,16 +229,15 @@ describe('ensureSharedHistory', () => {
229229 } ) ;
230230
231231 it ( 'deepens history if needed' , ( ) => {
232- const repo = repositoryFactory . cloneRepository ( { depth : 1 , branch : testBranch , singleBranch : true } ) ;
232+ const repo = repositoryFactory . cloneRepository ( { depth : 2 , branch : testBranch , singleBranch : true } ) ;
233233 gitSpy . mockClear ( ) ;
234234
235235 ensureSharedHistory ( {
236236 path : repo . rootPath ,
237237 branch : defaultRemoteBranchName ,
238238 fetch : true ,
239239 depth : 2 ,
240- // Run this with verbose git logs so we can verify arguments were correct (no "warning" logs).
241- // However, this adds noise including filesystem paths to the output, so we can't snapshot it.
240+ // Run this with verbose git logs so we can verify arguments were correct (no "warning" logs)
242241 verbose : true ,
243242 } ) ;
244243
@@ -247,20 +246,18 @@ describe('ensureSharedHistory', () => {
247246 expect ( allLogs ) . toMatch ( 'This is a shallow clone. Deepening to check for changes...' ) ;
248247 expect ( allLogs ) . toMatch ( 'Deepening by 2 more commits (attempt 1/3)...' ) ;
249248 expect ( allLogs ) . toMatch ( 'Deepening by 2 more commits (attempt 2/3)...' ) ;
250- expect ( allLogs ) . toMatch ( 'Deepening by 2 more commits (attempt 3/3)...' ) ;
249+ expect ( allLogs ) . not . toMatch ( 'Deepening by 2 more commits (attempt 3/3)...' ) ;
251250 expect ( allLogs ) . not . toMatch ( 'warning' ) ;
252251 expect ( logs . mocks . warn ) . not . toHaveBeenCalled ( ) ;
253252 expect ( logs . mocks . error ) . not . toHaveBeenCalled ( ) ;
254253
255- expect ( filteredGitCalls ( ) . filter ( line => ! line . startsWith ( 'rev-parse' ) && ! line . startsWith ( 'merge-base' ) ) )
256- . toMatchInlineSnapshot ( `
254+ expect ( filteredGitCalls ( ) ) . toMatchInlineSnapshot ( `
257255 [
258256 "config --get-all remote.origin.fetch",
259257 "remote set-branches --add origin master",
260258 "fetch --depth=2 origin master",
261259 "fetch --deepen=2 origin master",
262260 "fetch --deepen=2 origin master",
263- "fetch --deepen=2 origin master",
264261 ]
265262 ` ) ;
266263 } ) ;
0 commit comments