]> git.proxmox.com Git - libgit2.git/blobdiff - src/cherrypick.c
New upstream version 1.4.3+dfsg.1
[libgit2.git] / src / cherrypick.c
index 4287956c9c3a58e8816910019c224bfde5b20692..9ec4962b99a77c07615be88d9a422318735c1c2b 100644 (file)
@@ -26,10 +26,10 @@ static int write_cherrypick_head(
        const char *commit_oidstr)
 {
        git_filebuf file = GIT_FILEBUF_INIT;
-       git_buf file_path = GIT_BUF_INIT;
+       git_str file_path = GIT_STR_INIT;
        int error = 0;
 
-       if ((error = git_buf_joinpath(&file_path, repo->gitdir, GIT_CHERRYPICK_HEAD_FILE)) >= 0 &&
+       if ((error = git_str_joinpath(&file_path, repo->gitdir, GIT_CHERRYPICK_HEAD_FILE)) >= 0 &&
                (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_CREATE_LEADING_DIRS, GIT_CHERRYPICK_FILE_MODE)) >= 0 &&
                (error = git_filebuf_printf(&file, "%s\n", commit_oidstr)) >= 0)
                error = git_filebuf_commit(&file);
@@ -37,7 +37,7 @@ static int write_cherrypick_head(
        if (error < 0)
                git_filebuf_cleanup(&file);
 
-       git_buf_dispose(&file_path);
+       git_str_dispose(&file_path);
 
        return error;
 }
@@ -47,10 +47,10 @@ static int write_merge_msg(
        const char *commit_msg)
 {
        git_filebuf file = GIT_FILEBUF_INIT;
-       git_buf file_path = GIT_BUF_INIT;
+       git_str file_path = GIT_STR_INIT;
        int error = 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_CREATE_LEADING_DIRS, GIT_CHERRYPICK_FILE_MODE)) < 0 ||
                (error = git_filebuf_printf(&file, "%s", commit_msg)) < 0)
                goto cleanup;
@@ -61,7 +61,7 @@ cleanup:
        if (error < 0)
                git_filebuf_cleanup(&file);
 
-       git_buf_dispose(&file_path);
+       git_str_dispose(&file_path);
 
        return error;
 }
@@ -175,7 +175,7 @@ int git_cherrypick(
        git_commit *our_commit = NULL;
        char commit_oidstr[GIT_OID_HEXSZ + 1];
        const char *commit_msg, *commit_summary;
-       git_buf their_label = GIT_BUF_INIT;
+       git_str their_label = GIT_STR_INIT;
        git_index *index = NULL;
        git_indexwriter indexwriter = GIT_INDEXWRITER_INIT;
        int error = 0;
@@ -197,8 +197,8 @@ int git_cherrypick(
        git_oid_nfmt(commit_oidstr, sizeof(commit_oidstr), git_commit_id(commit));
 
        if ((error = write_merge_msg(repo, commit_msg)) < 0 ||
-               (error = git_buf_printf(&their_label, "%.7s... %s", commit_oidstr, commit_summary)) < 0 ||
-               (error = cherrypick_normalize_opts(repo, &opts, given_opts, git_buf_cstr(&their_label))) < 0 ||
+               (error = git_str_printf(&their_label, "%.7s... %s", commit_oidstr, commit_summary)) < 0 ||
+               (error = cherrypick_normalize_opts(repo, &opts, given_opts, git_str_cstr(&their_label))) < 0 ||
                (error = git_indexwriter_init_for_operation(&indexwriter, repo, &opts.checkout_opts.checkout_strategy)) < 0 ||
                (error = write_cherrypick_head(repo, commit_oidstr)) < 0 ||
                (error = git_repository_head(&our_ref, repo)) < 0 ||
@@ -220,7 +220,7 @@ done:
        git_index_free(index);
        git_commit_free(our_commit);
        git_reference_free(our_ref);
-       git_buf_dispose(&their_label);
+       git_str_dispose(&their_label);
 
        return error;
 }