File tree Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Expand file tree Collapse file tree 1 file changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -101,16 +101,12 @@ def call_subprocess(
101
101
102
102
return code , output , error
103
103
104
- def strip_and_split (s : "str" ) -> "List[str]" :
105
- """Strip trailing \x00 and split on \x00 a string.
106
104
105
+ def strip_and_split (s ):
106
+ """strip trailing \x00 and split on \x00
107
107
Useful for parsing output of git commands with -z flag.
108
108
"""
109
- s = s .strip ("\x00 " )
110
- if len (s ) > 0 :
111
- return s .split ("\x00 " )
112
- else :
113
- return list ()
109
+ return s .strip ("\x00 " ).split ("\x00 " )
114
110
115
111
116
112
class Git :
@@ -260,7 +256,7 @@ async def status(self, current_path):
260
256
}
261
257
262
258
result = []
263
- line_iterable = iter ( strip_and_split (my_output ))
259
+ line_iterable = line_iterable = ( line for line in strip_and_split (my_output )) if line )
264
260
for line in line_iterable :
265
261
result .append ({
266
262
"x" : line [0 ],
You can’t perform that action at this time.
0 commit comments