diff options
| author | Vicent Marti <tanoku@gmail.com> | 2010-11-14 22:11:46 +0200 |
|---|---|---|
| committer | Vicent Marti <tanoku@gmail.com> | 2010-11-16 02:59:28 +0200 |
| commit | c3a20d5cab7d17cf55e769c39a3d50882e3d341d (patch) | |
| tree | b00021319f63036e8a08c2b99d70e409adf111ef /src/repository.c | |
| parent | 7a3924fc38b63313e84c6339d2fd56084f5aeea6 (diff) | |
| download | libgit2-c3a20d5cab7d17cf55e769c39a3d50882e3d341d.tar.gz | |
Add support for 'index add'
Actually add files to the index by creating their corresponding blob and
storing it on the repository, then getting the hash and updating the
index file.
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src/repository.c')
| -rw-r--r-- | src/repository.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/repository.c b/src/repository.c index 4beb3e0c7..ef51b08e7 100644 --- a/src/repository.c +++ b/src/repository.c @@ -196,7 +196,7 @@ void git_repository_free(git_repository *repo) git_index *git_repository_index(git_repository *repo) { if (repo->index == NULL) { - if (git_index_open(&repo->index, repo->path_index, repo->path_workdir) < 0) + if (git_index_open_inrepo(&repo->index, repo) < 0) return NULL; assert(repo->index && repo->index->on_disk); @@ -298,8 +298,6 @@ static int write_back(git_object *object) object->source.raw.len = object->source.written_bytes; - git_obj_hash(&new_id, &object->source.raw); - if ((error = git_odb_write(&new_id, object->repo->db, &object->source.raw)) < 0) return error; |
