diff options
Diffstat (limited to 'src/index.c')
| -rw-r--r-- | src/index.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/index.c b/src/index.c index 606a431a4..76384288e 100644 --- a/src/index.c +++ b/src/index.c @@ -730,7 +730,7 @@ static int index_conflict_to_reuc(git_index *index, const char *path) return ret; } -int git_index_add_from_workdir(git_index *index, const char *path) +int git_index_add_bypath(git_index *index, const char *path) { git_index_entry *entry = NULL; int ret; @@ -753,6 +753,21 @@ on_error: return ret; } +int git_index_remove_bypath(git_index *index, const char *path) +{ + int ret; + + assert(index && path); + + if (((ret = git_index_remove(index, path, 0)) < 0 && + ret != GIT_ENOTFOUND) || + ((ret = index_conflict_to_reuc(index, path)) < 0 && + ret != GIT_ENOTFOUND)) + return ret; + + return 0; +} + int git_index_add(git_index *index, const git_index_entry *source_entry) { git_index_entry *entry = NULL; |
