Merge remote branch 'davidv/index'
This commit is contained in:
4
pygit2.c
4
pygit2.c
@@ -1498,9 +1498,9 @@ static PyObject *
|
|||||||
Index_add(Index *self, PyObject *args) {
|
Index_add(Index *self, PyObject *args) {
|
||||||
int err;
|
int err;
|
||||||
const char *path;
|
const char *path;
|
||||||
int stage;
|
int stage=0;
|
||||||
|
|
||||||
if (!PyArg_ParseTuple(args, "si", &path, &stage))
|
if (!PyArg_ParseTuple(args, "s|i", &path, &stage))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
err = git_index_add(self->index, path, stage);
|
err = git_index_add(self->index, path, stage);
|
||||||
|
@@ -67,7 +67,7 @@ class IndexTest(utils.RepoTestCase):
|
|||||||
|
|
||||||
sha = '0907563af06c7464d62a70cdd135a6ba7d2b41d8'
|
sha = '0907563af06c7464d62a70cdd135a6ba7d2b41d8'
|
||||||
self.assertFalse('bye.txt' in index)
|
self.assertFalse('bye.txt' in index)
|
||||||
index.add('bye.txt', 0)
|
index.add('bye.txt')
|
||||||
self.assertTrue('bye.txt' in index)
|
self.assertTrue('bye.txt' in index)
|
||||||
self.assertEqual(len(index), 3)
|
self.assertEqual(len(index), 3)
|
||||||
self.assertEqual(index['bye.txt'].sha, sha)
|
self.assertEqual(index['bye.txt'].sha, sha)
|
||||||
|
Reference in New Issue
Block a user