@@ -324,3 +324,41 @@ test("determineBaseBranchHeadCommitOid other error", async (t) => {
324324
325325 infoStub . restore ( ) ;
326326} ) ;
327+
328+ test ( "decodeGitFilePath unquoted strings" , async ( t ) => {
329+ t . deepEqual ( actionsUtil . decodeGitFilePath ( "foo" ) , "foo" ) ;
330+ t . deepEqual ( actionsUtil . decodeGitFilePath ( "foo bar" ) , "foo bar" ) ;
331+ t . deepEqual ( actionsUtil . decodeGitFilePath ( "foo\\\\bar" ) , "foo\\\\bar" ) ;
332+ t . deepEqual ( actionsUtil . decodeGitFilePath ( 'foo\\"bar' ) , 'foo\\"bar' ) ;
333+ t . deepEqual ( actionsUtil . decodeGitFilePath ( "foo\\001bar" ) , "foo\\001bar" ) ;
334+ t . deepEqual ( actionsUtil . decodeGitFilePath ( "foo\\abar" ) , "foo\\abar" ) ;
335+ t . deepEqual ( actionsUtil . decodeGitFilePath ( "foo\\bbar" ) , "foo\\bbar" ) ;
336+ t . deepEqual ( actionsUtil . decodeGitFilePath ( "foo\\fbar" ) , "foo\\fbar" ) ;
337+ t . deepEqual ( actionsUtil . decodeGitFilePath ( "foo\\nbar" ) , "foo\\nbar" ) ;
338+ t . deepEqual ( actionsUtil . decodeGitFilePath ( "foo\\rbar" ) , "foo\\rbar" ) ;
339+ t . deepEqual ( actionsUtil . decodeGitFilePath ( "foo\\tbar" ) , "foo\\tbar" ) ;
340+ t . deepEqual ( actionsUtil . decodeGitFilePath ( "foo\\vbar" ) , "foo\\vbar" ) ;
341+ t . deepEqual (
342+ actionsUtil . decodeGitFilePath ( "\\a\\b\\f\\n\\r\\t\\v" ) ,
343+ "\\a\\b\\f\\n\\r\\t\\v" ,
344+ ) ;
345+ } ) ;
346+
347+ test ( "decodeGitFilePath quoted strings" , async ( t ) => {
348+ t . deepEqual ( actionsUtil . decodeGitFilePath ( '"foo"' ) , "foo" ) ;
349+ t . deepEqual ( actionsUtil . decodeGitFilePath ( '"foo bar"' ) , "foo bar" ) ;
350+ t . deepEqual ( actionsUtil . decodeGitFilePath ( '"foo\\\\bar"' ) , "foo\\bar" ) ;
351+ t . deepEqual ( actionsUtil . decodeGitFilePath ( '"foo\\"bar"' ) , 'foo"bar' ) ;
352+ t . deepEqual ( actionsUtil . decodeGitFilePath ( '"foo\\001bar"' ) , "foo\x01bar" ) ;
353+ t . deepEqual ( actionsUtil . decodeGitFilePath ( '"foo\\abar"' ) , "foo\x07bar" ) ;
354+ t . deepEqual ( actionsUtil . decodeGitFilePath ( '"foo\\bbar"' ) , "foo\bbar" ) ;
355+ t . deepEqual ( actionsUtil . decodeGitFilePath ( '"foo\\fbar"' ) , "foo\fbar" ) ;
356+ t . deepEqual ( actionsUtil . decodeGitFilePath ( '"foo\\nbar"' ) , "foo\nbar" ) ;
357+ t . deepEqual ( actionsUtil . decodeGitFilePath ( '"foo\\rbar"' ) , "foo\rbar" ) ;
358+ t . deepEqual ( actionsUtil . decodeGitFilePath ( '"foo\\tbar"' ) , "foo\tbar" ) ;
359+ t . deepEqual ( actionsUtil . decodeGitFilePath ( '"foo\\vbar"' ) , "foo\vbar" ) ;
360+ t . deepEqual (
361+ actionsUtil . decodeGitFilePath ( '"\\a\\b\\f\\n\\r\\t\\v"' ) ,
362+ "\x07\b\f\n\r\t\v" ,
363+ ) ;
364+ } ) ;
0 commit comments