diff options
| author | nulltoken <emeric.fermas@gmail.com> | 2013-10-04 14:03:12 +0200 |
|---|---|---|
| committer | nulltoken <emeric.fermas@gmail.com> | 2013-10-04 15:54:36 +0200 |
| commit | da7b78fa446b31e7e197d51129d9bd005acc69da (patch) | |
| tree | f500bafe60706821b7539c109d6386fd6cfe73f5 /src/index.c | |
| parent | 6445ae994c8be706c58e441c1af2cddd0632b96e (diff) | |
| download | libgit2-da7b78fa446b31e7e197d51129d9bd005acc69da.tar.gz | |
index: Make _read() cope with index file creation
Diffstat (limited to 'src/index.c')
| -rw-r--r-- | src/index.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/index.c b/src/index.c index 21a8d31d1..c923f1675 100644 --- a/src/index.c +++ b/src/index.c @@ -461,9 +461,10 @@ int git_index_read(git_index *index) return create_index_error(-1, "Failed to read index: The index is in-memory only"); - if (!index->on_disk || git_path_exists(index->index_file_path) == false) { + index->on_disk = git_path_exists(index->index_file_path); + + if (!index->on_disk) { git_index_clear(index); - index->on_disk = 0; return 0; } |
