File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -247,15 +247,22 @@ DiffDelta_status_char(DiffDelta *self)
247247 return Py_BuildValue ("C" , status );
248248}
249249
250- PyDoc_STRVAR (DiffDelta_is_binary__doc__ , "True if binary data, False if not." );
250+ PyDoc_STRVAR (DiffDelta_is_binary__doc__ ,
251+ "True if binary data, False if text, None if not (yet) known."
252+ );
251253
252254PyObject *
253255DiffDelta_is_binary__get__ (DiffDelta * self )
254256{
255- if (!(self -> flags & GIT_DIFF_FLAG_NOT_BINARY ) &&
256- (self -> flags & GIT_DIFF_FLAG_BINARY ))
257+ if (self -> flags & GIT_DIFF_FLAG_BINARY )
257258 Py_RETURN_TRUE ;
258- Py_RETURN_FALSE ;
259+
260+ if (self -> flags & GIT_DIFF_FLAG_NOT_BINARY )
261+ Py_RETURN_FALSE ;
262+
263+ // This means the file has not been loaded, so we don't know whether it's
264+ // binary or text
265+ Py_RETURN_NONE ;
259266}
260267
261268static void
You can’t perform that action at this time.
0 commit comments