@@ -24,7 +24,7 @@ async def test_changed_files_single_commit():
24
24
with patch ("jupyterlab_git.git.execute" ) as mock_execute :
25
25
# Given
26
26
mock_execute .return_value = tornado .gen .maybe_future (
27
- (0 , "file1.ipynb\n file2 .py" , "" )
27
+ (0 , "file1.ipynb\x00 file2 .py" , "" )
28
28
)
29
29
30
30
# When
@@ -39,6 +39,7 @@ async def test_changed_files_single_commit():
39
39
"diff" ,
40
40
"64950a634cd11d1a01ddfedaeffed67b531cb11e^!" ,
41
41
"--name-only" ,
42
+ "-z" ,
42
43
],
43
44
cwd = "/bin" ,
44
45
)
@@ -50,7 +51,7 @@ async def test_changed_files_working_tree():
50
51
with patch ("jupyterlab_git.git.execute" ) as mock_execute :
51
52
# Given
52
53
mock_execute .return_value = tornado .gen .maybe_future (
53
- (0 , "file1.ipynb\n file2 .py" , "" )
54
+ (0 , "file1.ipynb\x00 file2 .py" , "" )
54
55
)
55
56
56
57
# When
@@ -60,7 +61,7 @@ async def test_changed_files_working_tree():
60
61
61
62
# Then
62
63
mock_execute .assert_called_once_with (
63
- ["git" , "diff" , "HEAD" , "--name-only" ], cwd = "/bin"
64
+ ["git" , "diff" , "HEAD" , "--name-only" , "-z" ], cwd = "/bin"
64
65
)
65
66
assert {"code" : 0 , "files" : ["file1.ipynb" , "file2.py" ]} == actual_response
66
67
@@ -70,7 +71,7 @@ async def test_changed_files_index():
70
71
with patch ("jupyterlab_git.git.execute" ) as mock_execute :
71
72
# Given
72
73
mock_execute .return_value = tornado .gen .maybe_future (
73
- (0 , "file1.ipynb\n file2 .py" , "" )
74
+ (0 , "file1.ipynb\x00 file2 .py" , "" )
74
75
)
75
76
76
77
# When
@@ -80,7 +81,7 @@ async def test_changed_files_index():
80
81
81
82
# Then
82
83
mock_execute .assert_called_once_with (
83
- ["git" , "diff" , "--staged" , "HEAD" , "--name-only" ], cwd = "/bin"
84
+ ["git" , "diff" , "--staged" , "HEAD" , "--name-only" , "-z" ], cwd = "/bin"
84
85
)
85
86
assert {"code" : 0 , "files" : ["file1.ipynb" , "file2.py" ]} == actual_response
86
87
@@ -90,7 +91,7 @@ async def test_changed_files_two_commits():
90
91
with patch ("jupyterlab_git.git.execute" ) as mock_execute :
91
92
# Given
92
93
mock_execute .return_value = tornado .gen .maybe_future (
93
- (0 , "file1.ipynb\n file2 .py" , "" )
94
+ (0 , "file1.ipynb\x00 file2 .py" , "" )
94
95
)
95
96
96
97
# When
@@ -100,7 +101,7 @@ async def test_changed_files_two_commits():
100
101
101
102
# Then
102
103
mock_execute .assert_called_once_with (
103
- ["git" , "diff" , "HEAD" , "origin/HEAD" , "--name-only" ], cwd = "/bin"
104
+ ["git" , "diff" , "HEAD" , "origin/HEAD" , "--name-only" , "-z" ], cwd = "/bin"
104
105
)
105
106
assert {"code" : 0 , "files" : ["file1.ipynb" , "file2.py" ]} == actual_response
106
107
@@ -118,6 +119,6 @@ async def test_changed_files_git_diff_error():
118
119
119
120
# Then
120
121
mock_execute .assert_called_once_with (
121
- ["git" , "diff" , "HEAD" , "origin/HEAD" , "--name-only" ], cwd = "/bin"
122
+ ["git" , "diff" , "HEAD" , "origin/HEAD" , "--name-only" , "-z" ], cwd = "/bin"
122
123
)
123
124
assert {"code" : 128 , "message" : "error message" } == actual_response
0 commit comments