diff options
Diffstat (limited to 'src/merge.c')
-rw-r--r-- | src/merge.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/merge.c b/src/merge.c index d838e4ba9..ae1d453ec 100644 --- a/src/merge.c +++ b/src/merge.c @@ -8,7 +8,7 @@ #include "merge.h" #include "posix.h" -#include "buffer.h" +#include "str.h" #include "repository.h" #include "revwalk.h" #include "commit_list.h" @@ -591,7 +591,7 @@ int git_repository_mergehead_foreach( git_repository_mergehead_foreach_cb cb, void *payload) { - git_buf merge_head_path = GIT_BUF_INIT, merge_head_file = GIT_BUF_INIT; + git_str merge_head_path = GIT_STR_INIT, merge_head_file = GIT_STR_INIT; char *buffer, *line; size_t line_num = 1; git_oid oid; @@ -600,12 +600,12 @@ int git_repository_mergehead_foreach( GIT_ASSERT_ARG(repo); GIT_ASSERT_ARG(cb); - if ((error = git_buf_joinpath(&merge_head_path, repo->gitdir, + if ((error = git_str_joinpath(&merge_head_path, repo->gitdir, GIT_MERGE_HEAD_FILE)) < 0) return error; if ((error = git_futils_readbuffer(&merge_head_file, - git_buf_cstr(&merge_head_path))) < 0) + git_str_cstr(&merge_head_path))) < 0) goto cleanup; buffer = merge_head_file.ptr; @@ -635,8 +635,8 @@ int git_repository_mergehead_foreach( } cleanup: - git_buf_dispose(&merge_head_path); - git_buf_dispose(&merge_head_file); + git_str_dispose(&merge_head_path); + git_str_dispose(&merge_head_file); return error; } @@ -893,7 +893,7 @@ static int merge_conflict_invoke_driver( git_merge_driver_source *src) { git_index_entry *result; - git_buf buf = GIT_BUF_INIT; + git_buf buf = {0}; const char *path; uint32_t mode; git_odb *odb = NULL; @@ -2473,14 +2473,14 @@ static int write_merge_head( size_t heads_len) { git_filebuf file = GIT_FILEBUF_INIT; - git_buf file_path = GIT_BUF_INIT; + git_str file_path = GIT_STR_INIT; size_t i; int error = 0; GIT_ASSERT_ARG(repo); GIT_ASSERT_ARG(heads); - if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_MERGE_HEAD_FILE)) < 0 || + if ((error = git_str_joinpath(&file_path, repo->gitdir, GIT_MERGE_HEAD_FILE)) < 0 || (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_CREATE_LEADING_DIRS, GIT_MERGE_FILE_MODE)) < 0) goto cleanup; @@ -2495,7 +2495,7 @@ cleanup: if (error < 0) git_filebuf_cleanup(&file); - git_buf_dispose(&file_path); + git_str_dispose(&file_path); return error; } @@ -2503,12 +2503,12 @@ cleanup: static int write_merge_mode(git_repository *repo) { git_filebuf file = GIT_FILEBUF_INIT; - git_buf file_path = GIT_BUF_INIT; + git_str file_path = GIT_STR_INIT; int error = 0; GIT_ASSERT_ARG(repo); - if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_MERGE_MODE_FILE)) < 0 || + if ((error = git_str_joinpath(&file_path, repo->gitdir, GIT_MERGE_MODE_FILE)) < 0 || (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_CREATE_LEADING_DIRS, GIT_MERGE_FILE_MODE)) < 0) goto cleanup; @@ -2521,7 +2521,7 @@ cleanup: if (error < 0) git_filebuf_cleanup(&file); - git_buf_dispose(&file_path); + git_str_dispose(&file_path); return error; } @@ -2719,7 +2719,7 @@ static int write_merge_msg( size_t heads_len) { git_filebuf file = GIT_FILEBUF_INIT; - git_buf file_path = GIT_BUF_INIT; + git_str file_path = GIT_STR_INIT; struct merge_msg_entry *entries; git_vector matching = GIT_VECTOR_INIT; size_t i; @@ -2740,7 +2740,7 @@ static int write_merge_msg( for (i = 0; i < heads_len; i++) entries[i].merge_head = heads[i]; - if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_MERGE_MSG_FILE)) < 0 || + if ((error = git_str_joinpath(&file_path, repo->gitdir, GIT_MERGE_MSG_FILE)) < 0 || (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_CREATE_LEADING_DIRS, GIT_MERGE_FILE_MODE)) < 0 || (error = git_filebuf_write(&file, "Merge ", 6)) < 0) goto cleanup; @@ -2822,7 +2822,7 @@ cleanup: if (error < 0) git_filebuf_cleanup(&file); - git_buf_dispose(&file_path); + git_str_dispose(&file_path); git_vector_free(&matching); git__free(entries); @@ -3114,7 +3114,7 @@ int git_merge__append_conflicts_to_merge_msg( git_index *index) { git_filebuf file = GIT_FILEBUF_INIT; - git_buf file_path = GIT_BUF_INIT; + git_str file_path = GIT_STR_INIT; const char *last = NULL; size_t i; int error; @@ -3122,7 +3122,7 @@ int git_merge__append_conflicts_to_merge_msg( if (!git_index_has_conflicts(index)) return 0; - if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_MERGE_MSG_FILE)) < 0 || + if ((error = git_str_joinpath(&file_path, repo->gitdir, GIT_MERGE_MSG_FILE)) < 0 || (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_APPEND, GIT_MERGE_FILE_MODE)) < 0) goto cleanup; @@ -3146,7 +3146,7 @@ cleanup: if (error < 0) git_filebuf_cleanup(&file); - git_buf_dispose(&file_path); + git_str_dispose(&file_path); return error; } |