@@ -222,17 +222,24 @@ Index__find(Index *self, PyObject *py_path)
222
222
223
223
224
224
PyDoc_STRVAR (Index_read__doc__ ,
225
- "read()\n"
225
+ "read(force=True )\n"
226
226
"\n"
227
227
"Update the contents of an existing index object in memory by reading from\n"
228
- "the hard disk." );
228
+ "the hard disk."
229
+ "Arguments:\n"
230
+ "\n"
231
+ "force: if True (the default) allways reload. If False, only if the file has changed"
232
+ );
229
233
230
234
PyObject *
231
- Index_read (Index * self )
235
+ Index_read (Index * self , PyObject * args )
232
236
{
233
- int err ;
237
+ int err , force = 1 ;
238
+
239
+ if (!PyArg_ParseTuple (args , "|i" , & force ))
240
+ return NULL ;
234
241
235
- err = git_index_read (self -> index );
242
+ err = git_index_read (self -> index , force );
236
243
if (err < GIT_OK )
237
244
return Error_set (err );
238
245
@@ -427,7 +434,7 @@ PyMethodDef Index_methods[] = {
427
434
METHOD (Index , diff_to_workdir , METH_VARARGS ),
428
435
METHOD (Index , diff_to_tree , METH_VARARGS ),
429
436
METHOD (Index , _find , METH_O ),
430
- METHOD (Index , read , METH_NOARGS ),
437
+ METHOD (Index , read , METH_VARARGS ),
431
438
METHOD (Index , write , METH_NOARGS ),
432
439
METHOD (Index , read_tree , METH_O ),
433
440
METHOD (Index , write_tree , METH_NOARGS ),
0 commit comments