summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2018-06-11 18:26:22 +0100
committerGitHub <noreply@github.com>2018-06-11 18:26:22 +0100
commit3be7301151e44537d2423386dc71f1d3e496c664 (patch)
tree655ff1fc09e227c77a1c8853706e5180a78f5a50 /src
parente6444dacb88e29e75fee81a87d1876db77d43362 (diff)
parentecf4f33a4e327a91496f72816f9f02d923e5af05 (diff)
downloadlibgit2-3be7301151e44537d2423386dc71f1d3e496c664.tar.gz
Merge pull request #4436 from pks-t/pks/packfile-stream-free
pack: rename `git_packfile_stream_free`
Diffstat (limited to 'src')
-rw-r--r--src/apply.c8
-rw-r--r--src/attr.c8
-rw-r--r--src/attr_file.c10
-rw-r--r--src/attrcache.c4
-rw-r--r--src/blob.c10
-rw-r--r--src/branch.c40
-rw-r--r--src/buffer.c13
-rw-r--r--src/checkout.c16
-rw-r--r--src/cherrypick.c6
-rw-r--r--src/clone.c26
-rw-r--r--src/commit.c6
-rw-r--r--src/config.c6
-rw-r--r--src/config_file.c22
-rw-r--r--src/config_parse.c6
-rw-r--r--src/diff.c4
-rw-r--r--src/diff_driver.c6
-rw-r--r--src/diff_file.c6
-rw-r--r--src/diff_generate.c4
-rw-r--r--src/diff_print.c16
-rw-r--r--src/diff_tform.c2
-rw-r--r--src/fetchhead.c10
-rw-r--r--src/filebuf.c8
-rw-r--r--src/fileops.c20
-rw-r--r--src/filter.c6
-rw-r--r--src/ignore.c10
-rw-r--r--src/index.c18
-rw-r--r--src/indexer.c18
-rw-r--r--src/iterator.c16
-rw-r--r--src/merge.c14
-rw-r--r--src/netops.c10
-rw-r--r--src/notes.c2
-rw-r--r--src/odb.c14
-rw-r--r--src/odb_loose.c26
-rw-r--r--src/odb_pack.c4
-rw-r--r--src/pack-objects.c4
-rw-r--r--src/pack.c10
-rw-r--r--src/pack.h2
-rw-r--r--src/patch.c2
-rw-r--r--src/patch_generate.c4
-rw-r--r--src/patch_parse.c8
-rw-r--r--src/path.c16
-rw-r--r--src/pathspec.c2
-rw-r--r--src/push.c2
-rw-r--r--src/rebase.c38
-rw-r--r--src/refdb_fs.c60
-rw-r--r--src/refs.c12
-rw-r--r--src/refspec.c2
-rw-r--r--src/remote.c66
-rw-r--r--src/repository.c112
-rw-r--r--src/reset.c2
-rw-r--r--src/revert.c6
-rw-r--r--src/revparse.c8
-rw-r--r--src/revwalk.c2
-rw-r--r--src/stash.c8
-rw-r--r--src/submodule.c61
-rw-r--r--src/sysdir.c8
-rw-r--r--src/tag.c14
-rw-r--r--src/trace.h2
-rw-r--r--src/transport.c4
-rw-r--r--src/transports/auth.c2
-rw-r--r--src/transports/auth_negotiate.c4
-rw-r--r--src/transports/git.c2
-rw-r--r--src/transports/http.c24
-rw-r--r--src/transports/local.c14
-rw-r--r--src/transports/smart.c2
-rw-r--r--src/transports/smart_pkt.c2
-rw-r--r--src/transports/smart_protocol.c10
-rw-r--r--src/transports/ssh.c2
-rw-r--r--src/transports/winhttp.c12
-rw-r--r--src/tree.c8
-rw-r--r--src/win32/findfile.c4
-rw-r--r--src/worktree.c40
72 files changed, 491 insertions, 485 deletions
diff --git a/src/apply.c b/src/apply.c
index 7801a0a54..8c7bb6bf3 100644
--- a/src/apply.c
+++ b/src/apply.c
@@ -255,7 +255,7 @@ static int apply_binary_delta(
if (!error && inflated.size != binary_file->inflatedlen) {
error = apply_err("inflated delta does not match expected length");
- git_buf_free(out);
+ git_buf_dispose(out);
}
if (error < 0)
@@ -281,7 +281,7 @@ static int apply_binary_delta(
}
done:
- git_buf_free(&inflated);
+ git_buf_dispose(&inflated);
return error;
}
@@ -320,9 +320,9 @@ static int apply_binary(
done:
if (error < 0)
- git_buf_free(out);
+ git_buf_dispose(out);
- git_buf_free(&reverse);
+ git_buf_dispose(&reverse);
return error;
}
diff --git a/src/attr.c b/src/attr.c
index 93d9551d9..9950e6f7d 100644
--- a/src/attr.c
+++ b/src/attr.c
@@ -298,7 +298,7 @@ static int system_attr_file(
/* We can safely provide a git_buf with no allocation (asize == 0) to
* a consumer. This allows them to treat this as a regular `git_buf`,
- * but their call to `git_buf_free` will not attempt to free it.
+ * but their call to `git_buf_dispose` will not attempt to free it.
*/
git_buf_attach_notowned(
out, attr_session->sysdir.ptr, attr_session->sysdir.size);
@@ -359,7 +359,7 @@ static int attr_setup(git_repository *repo, git_attr_session *attr_session)
attr_session->init_setup = 1;
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -565,8 +565,8 @@ static int collect_attr_files(
cleanup:
if (error < 0)
release_attr_files(files);
- git_buf_free(&attrfile);
- git_buf_free(&dir);
+ git_buf_dispose(&attrfile);
+ git_buf_dispose(&dir);
return error;
}
diff --git a/src/attr_file.c b/src/attr_file.c
index 6821587bc..f43375568 100644
--- a/src/attr_file.c
+++ b/src/attr_file.c
@@ -178,7 +178,7 @@ int git_attr_file__load(
cleanup:
git_blob_free(blob);
- git_buf_free(&content);
+ git_buf_dispose(&content);
return error;
}
@@ -348,7 +348,7 @@ int git_attr_file__load_standalone(git_attr_file **out, const char *path)
if (!(error = git_futils_readbuffer(&content, path))) {
error = git_attr_file__parse_buffer(NULL, file, content.ptr);
- git_buf_free(&content);
+ git_buf_dispose(&content);
}
if (error < 0)
@@ -518,7 +518,7 @@ int git_attr_path__init(
void git_attr_path__free(git_attr_path *info)
{
- git_buf_free(&info->full);
+ git_buf_dispose(&info->full);
info->path = NULL;
info->basename = NULL;
}
@@ -876,8 +876,8 @@ void git_attr_session__free(git_attr_session *session)
if (!session)
return;
- git_buf_free(&session->sysdir);
- git_buf_free(&session->tmp);
+ git_buf_dispose(&session->sysdir);
+ git_buf_dispose(&session->tmp);
memset(session, 0, sizeof(git_attr_session));
}
diff --git a/src/attrcache.c b/src/attrcache.c
index 65e7b4655..bb7e58731 100644
--- a/src/attrcache.c
+++ b/src/attrcache.c
@@ -204,7 +204,7 @@ cleanup:
*out_file = file;
*out_entry = entry;
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -310,7 +310,7 @@ static int attr_cache__lookup_path(
}
git_config_entry_free(entry);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
diff --git a/src/blob.c b/src/blob.c
index 3396fe74f..86ec95c48 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -126,7 +126,7 @@ static int write_file_filtered(
error = git_odb_write(id, odb, tgt.ptr, tgt.size, GIT_OBJ_BLOB);
}
- git_buf_free(&tgt);
+ git_buf_dispose(&tgt);
return error;
}
@@ -238,7 +238,7 @@ int git_blob__create_from_paths(
done:
git_odb_free(odb);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -257,7 +257,7 @@ int git_blob_create_fromdisk(
const char *workdir, *hintpath;
if ((error = git_path_prettify(&full_path, path, NULL)) < 0) {
- git_buf_free(&full_path);
+ git_buf_dispose(&full_path);
return error;
}
@@ -270,7 +270,7 @@ int git_blob_create_fromdisk(
error = git_blob__create_from_paths(
id, NULL, repo, git_buf_cstr(&full_path), hintpath, 0, true);
- git_buf_free(&full_path);
+ git_buf_dispose(&full_path);
return error;
}
@@ -340,7 +340,7 @@ cleanup:
if (error < 0)
blob_writestream_free((git_writestream *) stream);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
diff --git a/src/branch.c b/src/branch.c
index 42addc2ce..e72d470bb 100644
--- a/src/branch.c
+++ b/src/branch.c
@@ -40,7 +40,7 @@ static int retrieve_branch_reference(
*branch_reference_out = branch; /* will be NULL on error */
- git_buf_free(&ref_name);
+ git_buf_dispose(&ref_name);
return error;
}
@@ -108,8 +108,8 @@ static int create_branch(
*ref_out = branch;
cleanup:
- git_buf_free(&canonical_branch_name);
- git_buf_free(&log_message);
+ git_buf_dispose(&canonical_branch_name);
+ git_buf_dispose(&log_message);
return error;
}
@@ -199,7 +199,7 @@ int git_branch_delete(git_reference *branch)
error = git_reference_delete(branch);
on_error:
- git_buf_free(&config_section);
+ git_buf_dispose(&config_section);
return error;
}
@@ -310,10 +310,10 @@ int git_branch_move(
git_buf_cstr(&new_config_section));
done:
- git_buf_free(&new_reference_name);
- git_buf_free(&old_config_section);
- git_buf_free(&new_config_section);
- git_buf_free(&log_message);
+ git_buf_dispose(&new_reference_name);
+ git_buf_dispose(&old_config_section);
+ git_buf_dispose(&new_config_section);
+ git_buf_dispose(&log_message);
return error;
}
@@ -366,7 +366,7 @@ static int retrieve_upstream_configuration(
return -1;
error = git_config_get_string_buf(out, config, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -429,9 +429,9 @@ int git_branch_upstream_name(
cleanup:
git_config_free(config);
git_remote_free(remote);
- git_buf_free(&remote_name);
- git_buf_free(&merge_name);
- git_buf_free(&buf);
+ git_buf_dispose(&remote_name);
+ git_buf_dispose(&merge_name);
+ git_buf_dispose(&buf);
return error;
}
@@ -522,7 +522,7 @@ int git_branch_remote_name(git_buf *buf, git_repository *repo, const char *refna
cleanup:
if (error < 0)
- git_buf_free(buf);
+ git_buf_dispose(buf);
git_strarray_free(&remote_list);
return error;
@@ -544,7 +544,7 @@ int git_branch_upstream(
git_reference_owner(branch),
git_buf_cstr(&tracking_name));
- git_buf_free(&tracking_name);
+ git_buf_dispose(&tracking_name);
return error;
}
@@ -565,11 +565,11 @@ static int unset_upstream(git_config *config, const char *shortname)
if (git_config_delete_entry(config, git_buf_cstr(&buf)) < 0)
goto on_error;
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return 0;
on_error:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return -1;
}
@@ -655,15 +655,15 @@ int git_branch_set_upstream(git_reference *branch, const char *upstream_name)
goto on_error;
git_reference_free(upstream);
- git_buf_free(&key);
- git_buf_free(&value);
+ git_buf_dispose(&key);
+ git_buf_dispose(&value);
return 0;
on_error:
git_reference_free(upstream);
- git_buf_free(&key);
- git_buf_free(&value);
+ git_buf_dispose(&key);
+ git_buf_dispose(&value);
git_remote_free(remote);
return -1;
diff --git a/src/buffer.c b/src/buffer.c
index 8a58d1afa..1361bc0a6 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -116,7 +116,7 @@ int git_buf_grow_by(git_buf *buffer, size_t additional_size)
return git_buf_try_grow(buffer, newsize, true);
}
-void git_buf_free(git_buf *buf)
+void git_buf_dispose(git_buf *buf)
{
if (!buf) return;
@@ -126,6 +126,11 @@ void git_buf_free(git_buf *buf)
git_buf_init(buf, 0);
}
+void git_buf_free(git_buf *buf)
+{
+ git_buf_dispose(buf);
+}
+
void git_buf_sanitize(git_buf *buf)
{
if (buf->ptr == NULL) {
@@ -610,7 +615,7 @@ char *git_buf_detach(git_buf *buf)
int git_buf_attach(git_buf *buf, char *ptr, size_t asize)
{
- git_buf_free(buf);
+ git_buf_dispose(buf);
if (ptr) {
buf->ptr = ptr;
@@ -628,7 +633,7 @@ int git_buf_attach(git_buf *buf, char *ptr, size_t asize)
void git_buf_attach_notowned(git_buf *buf, const char *ptr, size_t size)
{
if (git_buf_is_allocated(buf))
- git_buf_free(buf);
+ git_buf_dispose(buf);
if (!size) {
git_buf_init(buf, 0);
@@ -949,7 +954,7 @@ int git_buf_quote(git_buf *buf)
git_buf_swap(&quoted, buf);
done:
- git_buf_free(&quoted);
+ git_buf_dispose(&quoted);
return error;
}
diff --git a/src/checkout.c b/src/checkout.c
index debdbe95b..c6936bf28 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -1604,7 +1604,7 @@ static int blob_content_to_link(
st->st_mode = GIT_FILEMODE_LINK;
}
- git_buf_free(&linktarget);
+ git_buf_dispose(&linktarget);
return error;
}
@@ -2161,13 +2161,13 @@ static int checkout_write_merge(
done:
git_filter_list_free(fl);
- git_buf_free(&out_data);
- git_buf_free(&our_label);
- git_buf_free(&their_label);
+ git_buf_dispose(&out_data);
+ git_buf_dispose(&our_label);
+ git_buf_dispose(&their_label);
git_merge_file_result_free(&result);
- git_buf_free(&path_workdir);
- git_buf_free(&path_suffixed);
+ git_buf_dispose(&path_workdir);
+ git_buf_dispose(&path_suffixed);
return error;
}
@@ -2347,8 +2347,8 @@ static void checkout_data_clear(checkout_data *data)
git__free(data->pfx);
data->pfx = NULL;
- git_buf_free(&data->target_path);
- git_buf_free(&data->tmp);
+ git_buf_dispose(&data->target_path);
+ git_buf_dispose(&data->tmp);
git_index_free(data->index);
data->index = NULL;
diff --git a/src/cherrypick.c b/src/cherrypick.c
index e42b74815..b61ce317f 100644
--- a/src/cherrypick.c
+++ b/src/cherrypick.c
@@ -37,7 +37,7 @@ static int write_cherrypick_head(
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
@@ -61,7 +61,7 @@ cleanup:
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
@@ -216,7 +216,7 @@ done:
git_index_free(index);
git_commit_free(our_commit);
git_reference_free(our_ref);
- git_buf_free(&their_label);
+ git_buf_dispose(&their_label);
return error;
}
diff --git a/src/clone.c b/src/clone.c
index 8764bb728..e2bf32069 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -48,7 +48,7 @@ static int create_branch(
return error;
error = git_reference_create(&branch_ref, repo, git_buf_cstr(&refname), target, 0, log_message);
- git_buf_free(&refname);
+ git_buf_dispose(&refname);
git_commit_free(head_obj);
if (!error)
@@ -87,8 +87,8 @@ static int setup_tracking_config(
error = 0;
cleanup:
- git_buf_free(&remote_key);
- git_buf_free(&merge_key);
+ git_buf_dispose(&remote_key);
+ git_buf_dispose(&merge_key);
return error;
}
@@ -195,8 +195,8 @@ static int update_head_to_remote(
reflog_message);
cleanup:
- git_buf_free(&remote_master_name);
- git_buf_free(&branch);
+ git_buf_dispose(&remote_master_name);
+ git_buf_dispose(&branch);
return error;
}
@@ -225,7 +225,7 @@ static int update_head_to_branch(
cleanup:
git_reference_free(remote_ref);
- git_buf_free(&remote_branch_name);
+ git_buf_dispose(&remote_branch_name);
return retcode;
}
@@ -351,7 +351,7 @@ static int clone_into(git_repository *repo, git_remote *_remote, const git_fetch
cleanup:
git_remote_free(remote);
- git_buf_free(&reflog_message);
+ git_buf_dispose(&reflog_message);
return error;
}
@@ -378,7 +378,7 @@ int git_clone__should_clone_local(const char *url_or_path, git_clone_local_t loc
git_path_isdir(path);
done:
- git_buf_free(&fromurl);
+ git_buf_dispose(&fromurl);
return is_local;
}
@@ -510,7 +510,7 @@ static int clone_local_into(git_repository *repo, git_remote *remote, const git_
/* Copy .git/objects/ from the source to the target */
if ((error = git_repository_open(&src, git_buf_cstr(&src_path))) < 0) {
- git_buf_free(&src_path);
+ git_buf_dispose(&src_path);
return error;
}
@@ -549,10 +549,10 @@ static int clone_local_into(git_repository *repo, git_remote *remote, const git_
error = checkout_branch(repo, remote, co_opts, branch, git_buf_cstr(&reflog_message));
cleanup:
- git_buf_free(&reflog_message);
- git_buf_free(&src_path);
- git_buf_free(&src_odb);
- git_buf_free(&dst_odb);
+ git_buf_dispose(&reflog_message);
+ git_buf_dispose(&src_path);
+ git_buf_dispose(&src_odb);
+ git_buf_dispose(&dst_odb);
git_repository_free(src);
return error;
}
diff --git a/src/commit.c b/src/commit.c
index 838688bb8..e0c090aa8 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -74,7 +74,7 @@ static int git_commit__create_buffer_internal(
return 0;
on_error:
- git_buf_free(out);
+ git_buf_dispose(out);
return -1;
}
@@ -176,7 +176,7 @@ static int git_commit__create_internal(
cleanup:
git_array_clear(parents);
git_reference_free(ref);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -886,6 +886,6 @@ int git_commit_create_with_signature(
goto cleanup;
cleanup:
- git_buf_free(&commit);
+ git_buf_dispose(&commit);
return error;
}
diff --git a/src/config.c b/src/config.c
index 1bc11b99f..03473af8e 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1164,7 +1164,7 @@ int git_config_open_default(git_config **out)
error = git_config_add_file_ondisk(cfg, buf.ptr,
GIT_CONFIG_LEVEL_PROGRAMDATA, NULL, 0);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error) {
git_config_free(cfg);
@@ -1478,8 +1478,8 @@ int git_config_rename_section(
config, git_buf_cstr(&pattern), rename_config_entries_cb, &data);
cleanup:
- git_buf_free(&pattern);
- git_buf_free(&replace);
+ git_buf_dispose(&pattern);
+ git_buf_dispose(&replace);
return error;
}
diff --git a/src/config_file.c b/src/config_file.c
index 6c652082c..90255c929 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -300,7 +300,7 @@ static int config_is_modified(int *modified, struct config_file *file)
}
out:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -688,7 +688,7 @@ static int config_unlock(git_config_backend *_cfg, int success)
}
git_filebuf_cleanup(&cfg->locked_buf);
- git_buf_free(&cfg->locked_content);
+ git_buf_dispose(&cfg->locked_content);
cfg->locked = false;
return error;
@@ -877,7 +877,7 @@ static char *escape_value(const char *ptr)
}
if (git_buf_oom(&buf)) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return NULL;
}
@@ -956,7 +956,7 @@ static int do_match_gitdir(
*matches = (error == 0);
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -1111,7 +1111,7 @@ static int config_read(
error = git_config_parse(&reader, NULL, read_on_variable, NULL, NULL, &parse_data);
out:
- git_buf_free(&contents);
+ git_buf_dispose(&contents);
return error;
}
@@ -1140,7 +1140,7 @@ static int write_section(git_buf *fbuf, const char *key)
return -1;
result = git_buf_put(fbuf, git_buf_cstr(&buf), buf.size);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return result;
}
@@ -1359,7 +1359,7 @@ static int config_write(diskfile_backend *cfg, const char *orig_key, const char
/* Lock the file */
if ((result = git_filebuf_open(
&file, cfg->file.path, GIT_FILEBUF_HASH_CONTENTS, GIT_CONFIG_FILE_MODE)) < 0) {
- git_buf_free(&contents);
+ git_buf_dispose(&contents);
return result;
}
@@ -1404,7 +1404,7 @@ static int config_write(diskfile_backend *cfg, const char *orig_key, const char
&write_data);
git__free(section);
git__free(orig_section);
- git_buf_free(&write_data.buffered_comment);
+ git_buf_dispose(&write_data.buffered_comment);
if (result < 0) {
git_filebuf_cleanup(&file);
@@ -1414,7 +1414,7 @@ static int config_write(diskfile_backend *cfg, const char *orig_key, const char
if (cfg->locked) {
size_t len = buf.asize;
/* Update our copy with the modified contents */
- git_buf_free(&cfg->locked_content);
+ git_buf_dispose(&cfg->locked_content);
git_buf_attach(&cfg->locked_content, git_buf_detach(&buf), len);
} else {
git_filebuf_write(&file, git_buf_cstr(&buf), git_buf_len(&buf));
@@ -1422,8 +1422,8 @@ static int config_write(diskfile_backend *cfg, const char *orig_key, const char
}
done:
- git_buf_free(&buf);
- git_buf_free(&contents);
+ git_buf_dispose(&buf);
+ git_buf_dispose(&contents);
git_parse_ctx_clear(&reader.ctx);
return result;
}
diff --git a/src/config_parse.c b/src/config_parse.c
index 149550dcd..66ac43237 100644
--- a/src/config_parse.c
+++ b/src/config_parse.c
@@ -130,7 +130,7 @@ end_parse:
if (line[rpos] != '"' || line[rpos + 1] != ']') {
set_parse_error(reader, rpos, "Unexpected text after closing quotes");
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return -1;
}
@@ -138,7 +138,7 @@ end_parse:
return 0;
end_error:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return -1;
}
@@ -437,7 +437,7 @@ static int parse_variable(git_config_parser *reader, char **var_name, char **var
if (parse_multiline_variable(reader, &multi_value, quote_count) < 0 ||
git_buf_oom(&multi_value)) {
- git_buf_free(&multi_value);
+ git_buf_dispose(&multi_value);
goto on_error;
}
diff --git a/src/diff.c b/src/diff.c
index c7a652896..c93e36b39 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -439,7 +439,7 @@ static int file_cb(
goto out;
out:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -477,7 +477,7 @@ static int line_cb(
goto out;
out:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
diff --git a/src/diff_driver.c b/src/diff_driver.c
index 7114b06b6..f75efb170 100644
--- a/src/diff_driver.c
+++ b/src/diff_driver.c
@@ -121,7 +121,7 @@ static int diff_driver_add_patterns(
if (error && pat != NULL)
(void)git_array_pop(drv->fn_patterns); /* release last item */
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* We want to ignore bad patterns, so return success regardless */
return 0;
@@ -338,7 +338,7 @@ static int git_diff_driver_load(
done:
git_config_entry_free(ce);
- git_buf_free(&name);
+ git_buf_dispose(&name);
git_config_free(cfg);
if (!*out) {
@@ -516,7 +516,7 @@ void git_diff_find_context_init(
void git_diff_find_context_clear(git_diff_find_context_payload *payload)
{
if (payload) {
- git_buf_free(&payload->line);
+ git_buf_dispose(&payload->line);
payload->driver = NULL;
}
}
diff --git a/src/diff_file.c b/src/diff_file.c
index 5bb9c372a..b98995d21 100644
--- a/src/diff_file.c
+++ b/src/diff_file.c
@@ -280,7 +280,7 @@ static int diff_file_content_load_workdir_symlink_fake(
fc->map.data = git_buf_detach(&target);
fc->flags |= GIT_DIFF_FLAG__FREE_DATA;
- git_buf_free(&target);
+ git_buf_dispose(&target);
return error;
}
@@ -361,7 +361,7 @@ static int diff_file_content_load_workdir_file(
error = git_filter_list_apply_to_data(&out, fl, &raw);
if (out.ptr != raw.ptr)
- git_buf_free(&raw);
+ git_buf_dispose(&raw);
if (!error) {
fc->map.len = out.size;
@@ -406,7 +406,7 @@ static int diff_file_content_load_workdir(
fc->file->flags |= GIT_DIFF_FLAG_VALID_ID;
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
diff --git a/src/diff_generate.c b/src/diff_generate.c
index 0105c1701..539269a99 100644
--- a/src/diff_generate.c
+++ b/src/diff_generate.c
@@ -601,7 +601,7 @@ int git_diff__oid_for_entry(
if (p_stat(full_path.ptr, &st) < 0) {
error = git_path_set_error(errno, entry.path, "stat");
- git_buf_free(&full_path);
+ git_buf_dispose(&full_path);
return error;
}
@@ -664,7 +664,7 @@ int git_diff__oid_for_entry(
}
}
- git_buf_free(&full_path);
+ git_buf_dispose(&full_path);
return error;
}
diff --git a/src/diff_print.c b/src/diff_print.c
index 5e535482c..090b4e86b 100644
--- a/src/diff_print.c
+++ b/src/diff_print.c
@@ -373,8 +373,8 @@ int diff_delta_format_similarity_header(
error = -1;
done:
- git_buf_free(&old_path);
- git_buf_free(&new_path);
+ git_buf_dispose(&old_path);
+ git_buf_dispose(&new_path);
return error;
}
@@ -446,8 +446,8 @@ int git_diff_delta__format_file_header(
error = -1;
done:
- git_buf_free(&old_path);
- git_buf_free(&new_path);
+ git_buf_dispose(&old_path);
+ git_buf_dispose(&new_path);
return error;
}
@@ -509,8 +509,8 @@ static int diff_print_patch_file_binary_noshow(
old_path.ptr, new_path.ptr);
done:
- git_buf_free(&old_path);
- git_buf_free(&new_path);
+ git_buf_dispose(&old_path);
+ git_buf_dispose(&new_path);
return error;
}
@@ -696,7 +696,7 @@ int git_diff_print(
giterr_set_after_callback_function(error, "git_diff_print");
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -776,7 +776,7 @@ int git_patch_print(
giterr_set_after_callback_function(error, "git_patch_print");
}
- git_buf_free(&temp);
+ git_buf_dispose(&temp);
return error;
}
diff --git a/src/diff_tform.c b/src/diff_tform.c
index bc664dd05..71330654a 100644
--- a/src/diff_tform.c
+++ b/src/diff_tform.c
@@ -529,7 +529,7 @@ static void similarity_unload(similarity_info *info)
if (info->blob)
git_blob_free(info->blob);
else
- git_buf_free(&info->data);
+ git_buf_dispose(&info->data);
}
#define FLAG_SET(opts,flag_name) (((opts)->flags & flag_name) != 0)
diff --git a/src/fetchhead.c b/src/fetchhead.c
index e55e7c85b..e71021624 100644
--- a/src/fetchhead.c
+++ b/src/fetchhead.c
@@ -119,11 +119,11 @@ int git_fetchhead_write(git_repository *repo, git_vector *fetchhead_refs)
return -1;
if (git_filebuf_open(&file, path.ptr, GIT_FILEBUF_APPEND, GIT_REFS_FILE_MODE) < 0) {
- git_buf_free(&path);
+ git_buf_dispose(&path);
return -1;
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_vector_sort(fetchhead_refs);
@@ -283,9 +283,9 @@ int git_repository_fetchhead_foreach(git_repository *repo,
}
done:
- git_buf_free(&file);
- git_buf_free(&path);
- git_buf_free(&name);
+ git_buf_dispose(&file);
+ git_buf_dispose(&path);
+ git_buf_dispose(&name);
return error;
}
diff --git a/src/filebuf.c b/src/filebuf.c
index 8b7e489da..401910c44 100644
--- a/src/filebuf.c
+++ b/src/filebuf.c
@@ -256,7 +256,7 @@ static int resolve_symlink(git_buf *out, const char *path)
goto cleanup;
git_buf_swap(&curpath, &dir);
- git_buf_free(&dir);
+ git_buf_dispose(&dir);
if ((error = git_path_apply_relative(&curpath, target.ptr)) < 0)
goto cleanup;
@@ -267,8 +267,8 @@ static int resolve_symlink(git_buf *out, const char *path)
error = -1;
cleanup:
- git_buf_free(&curpath);
- git_buf_free(&target);
+ git_buf_dispose(&curpath);
+ git_buf_dispose(&target);
return error;
}
@@ -343,7 +343,7 @@ int git_filebuf_open_withsize(git_filebuf *file, const char *path, int flags, mo
file->fd = git_futils_mktmp(&tmp_path, path, mode);
if (file->fd < 0) {
- git_buf_free(&tmp_path);
+ git_buf_dispose(&tmp_path);
goto cleanup;
}
file->fd_is_open = true;
diff --git a/src/fileops.c b/src/fileops.c
index 58988c2d2..b1a9f032a 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -159,7 +159,7 @@ int git_futils_readbuffer_fd(git_buf *buf, git_file fd, size_t len)
if (read_size != (ssize_t)len) {
giterr_set(GITERR_OS, "failed to read descriptor");
- git_buf_free(buf);
+ git_buf_dispose(buf);
return -1;
}
@@ -209,7 +209,7 @@ int git_futils_readbuffer_updated(
if (checksum) {
if ((error = git_hash_buf(&checksum_new, buf.ptr, buf.size)) < 0) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -217,7 +217,7 @@ int git_futils_readbuffer_updated(
* If we were given a checksum, we only want to use it if it's different
*/
if (!git_oid__cmp(checksum, &checksum_new)) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (updated)
*updated = 0;
@@ -234,7 +234,7 @@ int git_futils_readbuffer_updated(
*updated = 1;
git_buf_swap(out, &buf);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return 0;
}
@@ -526,8 +526,8 @@ int git_futils_mkdir(
parent_path.size ? parent_path.ptr : NULL, mode, flags, &opts);
done:
- git_buf_free(&make_path);
- git_buf_free(&parent_path);
+ git_buf_dispose(&make_path);
+ git_buf_dispose(&parent_path);
return error;
}
@@ -661,7 +661,7 @@ retry_lstat:
}
done:
- git_buf_free(&make_path);
+ git_buf_dispose(&make_path);
return error;
}
@@ -822,7 +822,7 @@ int git_futils_rmdir_r(
error = 0;
}
- git_buf_free(&fullpath);
+ git_buf_dispose(&fullpath);
return error;
}
@@ -1081,8 +1081,8 @@ int git_futils_cp_r(
error = _cp_r_callback(&info, &path);
- git_buf_free(&path);
- git_buf_free(&info.to);
+ git_buf_dispose(&path);
+ git_buf_dispose(&info.to);
return error;
}
diff --git a/src/filter.c b/src/filter.c
index 6ab09790b..cf8fe7dec 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -841,8 +841,8 @@ static void proxy_stream_free(git_writestream *s)
struct proxy_stream *proxy_stream = (struct proxy_stream *)s;
assert(proxy_stream);
- git_buf_free(&proxy_stream->input);
- git_buf_free(&proxy_stream->temp_buf);
+ git_buf_dispose(&proxy_stream->input);
+ git_buf_dispose(&proxy_stream->temp_buf);
git__free(proxy_stream);
}
@@ -977,7 +977,7 @@ done:
if (fd >= 0)
p_close(fd);
stream_list_free(&filter_streams);
- git_buf_free(&abspath);
+ git_buf_dispose(&abspath);
return error;
}
diff --git a/src/ignore.c b/src/ignore.c
index 3b68e14a8..e1d5fc9af 100644
--- a/src/ignore.c
+++ b/src/ignore.c
@@ -158,7 +158,7 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
out:
git__free(path);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -315,7 +315,7 @@ int git_ignore__for_path(
(error = git_path_to_dir(&local)) < 0 ||
(error = git_buf_joinpath(&ignores->dir, workdir, local.ptr)) < 0)
{;} /* Nothing, we just want to stop on the first error */
- git_buf_free(&local);
+ git_buf_dispose(&local);
} else {
error = git_buf_joinpath(&ignores->dir, path, "");
}
@@ -355,7 +355,7 @@ int git_ignore__for_path(
git_repository_attr_cache(repo)->cfg_excl_file);
cleanup:
- git_buf_free(&infopath);
+ git_buf_dispose(&infopath);
if (error < 0)
git_ignore__free(ignores);
@@ -427,7 +427,7 @@ void git_ignore__free(git_ignores *ignores)
}
git_vector_free(&ignores->ign_global);
- git_buf_free(&ignores->dir);
+ git_buf_dispose(&ignores->dir);
}
static bool ignore_lookup_in_rules(
@@ -632,7 +632,7 @@ int git_ignore__check_pathspec_for_exact_ignores(
}
git_index_free(idx);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
diff --git a/src/index.c b/src/index.c
index 18853f312..67c844c50 100644
--- a/src/index.c
+++ b/src/index.c
@@ -668,7 +668,7 @@ int git_index_read(git_index *index, int force)
if (!error)
git_futils_filestamp_set(&index->stamp, &stamp);
- git_buf_free(&buffer);
+ git_buf_dispose(&buffer);
return error;
}
@@ -949,7 +949,7 @@ static int index_entry_init(
return -1;
error = git_path_lstat(path.ptr, &st);
- git_buf_free(&path);
+ git_buf_dispose(&path);
if (error < 0)
return error;
@@ -1509,7 +1509,7 @@ static int add_repo_as_submodule(git_index_entry **out, git_index *index, const
git_reference_free(head);
git_repository_free(sub);
- git_buf_free(&abspath);
+ git_buf_dispose(&abspath);
*out = entry;
return 0;
@@ -1693,7 +1693,7 @@ int git_index_remove_directory(git_index *index, const char *dir, int stage)
/* removed entry at 'pos' so we don't need to increment */
}
- git_buf_free(&pfx);
+ git_buf_dispose(&pfx);
return error;
}
@@ -2819,7 +2819,7 @@ static int write_name_extension(git_index *index, git_filebuf *file)
error = write_extension(file, &extension, &name_buf);
- git_buf_free(&name_buf);
+ git_buf_dispose(&name_buf);
done:
return error;
@@ -2867,7 +2867,7 @@ static int write_reuc_extension(git_index *index, git_filebuf *file)
error = write_extension(file, &extension, &reuc_buf);
- git_buf_free(&reuc_buf);
+ git_buf_dispose(&reuc_buf);
done:
return error;
@@ -2891,7 +2891,7 @@ static int write_tree_extension(git_index *index, git_filebuf *file)
error = write_extension(file, &extension, &buf);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -3008,7 +3008,7 @@ static int read_tree_cb(
}
index_entry_adjust_namemask(entry, path.size);
- git_buf_free(&path);
+ git_buf_dispose(&path);
if (git_vector_insert(data->new_entries, entry) < 0) {
index_entry_free(entry);
@@ -3463,7 +3463,7 @@ static int index_apply_to_all(
}
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_pathspec__clear(&ps);
return error;
diff --git a/src/indexer.c b/src/indexer.c
index c0976f270..744a03cf0 100644
--- a/src/indexer.c
+++ b/src/indexer.c
@@ -134,12 +134,12 @@ int git_indexer_new(
goto cleanup;
fd = git_futils_mktmp(&tmp_path, git_buf_cstr(&path), idx->mode);
- git_buf_free(&path);
+ git_buf_dispose(&path);
if (fd < 0)
goto cleanup;
error = git_packfile_alloc(&idx->pack, git_buf_cstr(&tmp_path));
- git_buf_free(&tmp_path);
+ git_buf_dispose(&tmp_path);
if (error < 0)
goto cleanup;
@@ -161,8 +161,8 @@ cleanup:
if (idx->pack != NULL)
p_unlink(idx->pack->pack_name);
- git_buf_free(&path);
- git_buf_free(&tmp_path);
+ git_buf_dispose(&path);
+ git_buf_dispose(&tmp_path);
git__free(idx);
return -1;
}
@@ -650,7 +650,7 @@ int git_indexer_append(git_indexer *idx, const void *data, size_t size, git_tran
/* We want to free the stream reasorces no matter what here */
idx->have_stream = 0;
- git_packfile_stream_free(stream);
+ git_packfile_stream_dispose(stream);
if (error < 0)
goto on_error;
@@ -758,7 +758,7 @@ static int inject_object(git_indexer *idx, git_oid *id)
idx->pack->mwf.size += buf.size;
entry->crc = htonl(crc32(entry->crc, (unsigned char *)buf.ptr, (uInt)buf.size));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* Write a fake trailer so the pack functions play ball */
@@ -1121,13 +1121,13 @@ int git_indexer_commit(git_indexer *idx, git_transfer_progress *stats)
idx->pack_committed = 1;
- git_buf_free(&filename);
+ git_buf_dispose(&filename);
return 0;
on_error:
git_mwindow_free_all(&idx->pack->mwf);
git_filebuf_cleanup(&index_file);
- git_buf_free(&filename);
+ git_buf_dispose(&filename);
return -1;
}
@@ -1137,7 +1137,7 @@ void git_indexer_free(git_indexer *idx)
return;
if (idx->have_stream)
- git_packfile_stream_free(&idx->stream);
+ git_packfile_stream_dispose(&idx->stream);
git_vector_free_deep(&idx->objects);
diff --git a/src/iterator.c b/src/iterator.c
index ff075ce8c..6e7300af3 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -701,7 +701,7 @@ static void tree_iterator_frame_pop(tree_iterator *iter)
do {
buf = git_array_pop(frame->similar_paths);
- git_buf_free(buf);
+ git_buf_dispose(buf);
} while (buf != NULL);
git_array_clear(frame->similar_paths);
@@ -711,7 +711,7 @@ static void tree_iterator_frame_pop(tree_iterator *iter)
git_vector_free(&frame->similar_trees);
- git_buf_free(&frame->path);
+ git_buf_dispose(&frame->path);
}
static int tree_iterator_current(
@@ -929,7 +929,7 @@ static void tree_iterator_free(git_iterator *i)
tree_iterator_clear(iter);
git_tree_free(iter->root);
- git_buf_free(&iter->entry_path);
+ git_buf_dispose(&iter->entry_path);
}
int git_iterator_for_tree(
@@ -1435,7 +1435,7 @@ done:
if (error < 0)
git_array_pop(iter->frames);
- git_buf_free(&root);
+ git_buf_dispose(&root);
git_path_diriter_free(&diriter);
return error;
}
@@ -1523,7 +1523,7 @@ static int filesystem_iterator_is_dir(
*is_dir = S_ISDIR(st.st_mode);
done:
- git_buf_free(&fullpath);
+ git_buf_dispose(&fullpath);
return error;
}
@@ -1804,7 +1804,7 @@ static void filesystem_iterator_clear(filesystem_iterator *iter)
git_array_clear(iter->frames);
git_ignore__free(&iter->ignores);
- git_buf_free(&iter->tmp_buf);
+ git_buf_dispose(&iter->tmp_buf);
iterator_clear(&iter->base);
}
@@ -1838,7 +1838,7 @@ static void filesystem_iterator_free(git_iterator *i)
{
filesystem_iterator *iter = (filesystem_iterator *)i;
git__free(iter->root);
- git_buf_free(&iter->current_path);
+ git_buf_dispose(&iter->current_path);
git_tree_free(iter->tree);
if (iter->index)
git_index_snapshot_release(&iter->index_snapshot, iter->index);
@@ -2176,7 +2176,7 @@ static void index_iterator_free(git_iterator *i)
index_iterator *iter = (index_iterator *)i;
git_index_snapshot_release(&iter->entries, iter->base.index);
- git_buf_free(&iter->tree_buf);
+ git_buf_dispose(&iter->tree_buf);
}
int git_iterator_for_index(
diff --git a/src/merge.c b/src/merge.c
index 6c98d13fb..068a23e20 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -599,8 +599,8 @@ int git_repository_mergehead_foreach(
}
cleanup:
- git_buf_free(&merge_head_path);
- git_buf_free(&merge_head_file);
+ git_buf_dispose(&merge_head_path);
+ git_buf_dispose(&merge_head_file);
return error;
}
@@ -875,7 +875,7 @@ static int merge_conflict_invoke_driver(
*out = result;
done:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_odb_free(odb);
return error;
@@ -2444,7 +2444,7 @@ cleanup:
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
@@ -2470,7 +2470,7 @@ cleanup:
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
@@ -2770,7 +2770,7 @@ cleanup:
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
git_vector_free(&matching);
git__free(entries);
@@ -3090,7 +3090,7 @@ cleanup:
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
diff --git a/src/netops.c b/src/netops.c
index fa20cbaf2..efcc6c5a7 100644
--- a/src/netops.c
+++ b/src/netops.c
@@ -292,10 +292,10 @@ int gitno_extract_url_parts(
*password_out = git_buf_detach(&password);
done:
- git_buf_free(&host);
- git_buf_free(&port);
- git_buf_free(&path);
- git_buf_free(&username);
- git_buf_free(&password);
+ git_buf_dispose(&host);
+ git_buf_dispose(&port);
+ git_buf_dispose(&path);
+ git_buf_dispose(&username);
+ git_buf_dispose(&password);
return error;
}
diff --git a/src/notes.c b/src/notes.c
index f63ef3667..b4c01226f 100644
--- a/src/notes.c
+++ b/src/notes.c
@@ -710,7 +710,7 @@ static int process_entry_path(
error = git_oid_fromstr(annotated_object_id, buf.ptr);
cleanup:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
diff --git a/src/odb.c b/src/odb.c
index ef9c87555..919a9510a 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -260,12 +260,12 @@ int git_odb__hashfd_filtered(
error = git_filter_list_apply_to_data(&post, fl, &raw);
- git_buf_free(&raw);
+ git_buf_dispose(&raw);
if (!error)
error = git_odb_hash(out, post.ptr, post.size, type);
- git_buf_free(&post);
+ git_buf_dispose(&post);
}
return error;
@@ -588,12 +588,12 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_
return -1;
if (git_path_exists(alternates_path.ptr) == false) {
- git_buf_free(&alternates_path);
+ git_buf_dispose(&alternates_path);
return 0;
}
if (git_futils_readbuffer(&alternates_buf, alternates_path.ptr) < 0) {
- git_buf_free(&alternates_path);
+ git_buf_dispose(&alternates_path);
return -1;
}
@@ -619,8 +619,8 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_
break;
}
- git_buf_free(&alternates_path);
- git_buf_free(&alternates_buf);
+ git_buf_dispose(&alternates_path);
+ git_buf_dispose(&alternates_buf);
return result;
}
@@ -1181,7 +1181,7 @@ static int read_prefix_1(git_odb_object **out, git_odb *db,
git_oid_tostr_s(&found_full_oid));
error = git_odb__error_ambiguous(buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
goto out;
}
diff --git a/src/odb_loose.c b/src/odb_loose.c
index 470421e15..c37b1eda2 100644
--- a/src/odb_loose.c
+++ b/src/odb_loose.c
@@ -266,7 +266,7 @@ static int read_loose_packlike(git_rawobj *out, git_buf *obj)
out->data = git_buf_detach(&body);
done:
- git_buf_free(&body);
+ git_buf_dispose(&body);
return error;
}
@@ -362,7 +362,7 @@ static int read_loose(git_rawobj *out, git_buf *loc)
error = read_loose_standard(out, &obj);
done:
- git_buf_free(&obj);
+ git_buf_dispose(&obj);
return error;
}
@@ -593,7 +593,7 @@ static int loose_backend__read_header(size_t *len_p, git_otype *type_p, git_odb_
*type_p = raw.type;
}
- git_buf_free(&object_path);
+ git_buf_dispose(&object_path);
return error;
}
@@ -615,7 +615,7 @@ static int loose_backend__read(void **buffer_p, size_t *len_p, git_otype *type_p
*type_p = raw.type;
}
- git_buf_free(&object_path);
+ git_buf_dispose(&object_path);
return error;
}
@@ -653,7 +653,7 @@ static int loose_backend__read_prefix(
*type_p = raw.type;
}
- git_buf_free(&object_path);
+ git_buf_dispose(&object_path);
}
return error;
@@ -668,7 +668,7 @@ static int loose_backend__exists(git_odb_backend *backend, const git_oid *oid)
error = locate_object(&object_path, (loose_backend *)backend, oid);
- git_buf_free(&object_path);
+ git_buf_dispose(&object_path);
return !error;
}
@@ -684,7 +684,7 @@ static int loose_backend__exists_prefix(
error = locate_object_short_oid(
&object_path, out, (loose_backend *)backend, short_id, len);
- git_buf_free(&object_path);
+ git_buf_dispose(&object_path);
return error;
}
@@ -770,7 +770,7 @@ static int loose_backend__foreach(git_odb_backend *_backend, git_odb_foreach_cb
error = git_path_direach(&buf, 0, foreach_cb, &state);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -789,7 +789,7 @@ static int loose_backend__writestream_finalize(git_odb_stream *_stream, const gi
error = git_filebuf_commit_at(
&stream->fbuf, final_path.ptr);
- git_buf_free(&final_path);
+ git_buf_dispose(&final_path);
return error;
}
@@ -856,7 +856,7 @@ static int loose_backend__writestream(git_odb_stream **stream_out, git_odb_backe
git__free(stream);
stream = NULL;
}
- git_buf_free(&tmp_path);
+ git_buf_dispose(&tmp_path);
*stream_out = (git_odb_stream *)stream;
return !stream ? -1 : 0;
@@ -1035,7 +1035,7 @@ done:
git__free(stream);
}
- git_buf_free(&object_path);
+ git_buf_dispose(&object_path);
return error;
}
@@ -1074,7 +1074,7 @@ static int loose_backend__write(git_odb_backend *_backend, const git_oid *oid, c
cleanup:
if (error < 0)
git_filebuf_cleanup(&fbuf);
- git_buf_free(&final_path);
+ git_buf_dispose(&final_path);
return error;
}
@@ -1090,7 +1090,7 @@ static int loose_backend__freshen(
return -1;
error = git_futils_touch(path.ptr, NULL);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
diff --git a/src/odb_pack.c b/src/odb_pack.c
index 20aff5386..2c3048034 100644
--- a/src/odb_pack.c
+++ b/src/odb_pack.c
@@ -346,7 +346,7 @@ static int pack_backend__refresh(git_odb_backend *backend_)
/* reload all packs */
error = git_path_direach(&path, 0, packfile_load__cb, backend);
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_vector_sort(&backend->packs);
return error;
@@ -635,7 +635,7 @@ int git_odb_backend_pack(git_odb_backend **backend_out, const char *objects_dir)
*backend_out = (git_odb_backend *)backend;
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
diff --git a/src/pack-objects.c b/src/pack-objects.c
index e9245143c..bc5fb2e1f 100644
--- a/src/pack-objects.c
+++ b/src/pack-objects.c
@@ -1095,7 +1095,7 @@ on_error:
git__free(array[i].data);
}
git__free(array);
- git_buf_free(&zbuf);
+ git_buf_dispose(&zbuf);
return error;
}
@@ -1463,7 +1463,7 @@ int git_packbuilder_insert_tree(git_packbuilder *pb, const git_oid *oid)
error = git_tree_walk(tree, GIT_TREEWALK_PRE, cb_tree_walk, &context);
git_tree_free(tree);
- git_buf_free(&context.buf);
+ git_buf_dispose(&context.buf);
return error;
}
diff --git a/src/pack.c b/src/pack.c
index 9ed3ec1af..6f837cd64 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -326,19 +326,19 @@ static int pack_index_open(struct git_pack_file *p)
git_buf_put(&idx_name, p->pack_name, name_len - strlen(".pack"));
git_buf_puts(&idx_name, ".idx");
if (git_buf_oom(&idx_name)) {
- git_buf_free(&idx_name);
+ git_buf_dispose(&idx_name);
return -1;
}
if ((error = git_mutex_lock(&p->lock)) < 0) {
- git_buf_free(&idx_name);
+ git_buf_dispose(&idx_name);
return error;
}
if (p->index_version == -1)
error = pack_index_check(idx_name.ptr, p);
- git_buf_free(&idx_name);
+ git_buf_dispose(&idx_name);
git_mutex_unlock(&p->lock);
@@ -499,7 +499,7 @@ int git_packfile_resolve_header(
if ((error = git_packfile_stream_open(&stream, p, curpos)) < 0)
return error;
error = git_delta_read_header_fromstream(&base_size, size_p, &stream);
- git_packfile_stream_free(&stream);
+ git_packfile_stream_dispose(&stream);
if (error < 0)
return error;
} else {
@@ -840,7 +840,7 @@ ssize_t git_packfile_stream_read(git_packfile_stream *obj, void *buffer, size_t
}
-void git_packfile_stream_free(git_packfile_stream *obj)
+void git_packfile_stream_dispose(git_packfile_stream *obj)
{
inflateEnd(&obj->zstream);
}
diff --git a/src/pack.h b/src/pack.h
index c0ca74f14..e1d8d040e 100644
--- a/src/pack.h
+++ b/src/pack.h
@@ -144,7 +144,7 @@ int git_packfile_unpack(git_rawobj *obj, struct git_pack_file *p, git_off_t *obj
int git_packfile_stream_open(git_packfile_stream *obj, struct git_pack_file *p, git_off_t curpos);
ssize_t git_packfile_stream_read(git_packfile_stream *obj, void *buffer, size_t len);
-void git_packfile_stream_free(git_packfile_stream *obj);
+void git_packfile_stream_dispose(git_packfile_stream *obj);
git_off_t get_delta_base(struct git_pack_file *p, git_mwindow **w_curs,
git_off_t *curpos, git_otype type,
diff --git a/src/patch.c b/src/patch.c
index 5e329518d..15d2ca811 100644
--- a/src/patch.c
+++ b/src/patch.c
@@ -84,7 +84,7 @@ size_t git_patch_size(
else
out += git_buf_len(&file_header);
- git_buf_free(&file_header);
+ git_buf_dispose(&file_header);
}
return out;
diff --git a/src/patch_generate.c b/src/patch_generate.c
index 29cda8b1c..800d0e2b1 100644
--- a/src/patch_generate.c
+++ b/src/patch_generate.c
@@ -314,8 +314,8 @@ static int create_binary(
}
done:
- git_buf_free(&deflate);
- git_buf_free(&delta);
+ git_buf_dispose(&deflate);
+ git_buf_dispose(&delta);
return error;
}
diff --git a/src/patch_parse.c b/src/patch_parse.c
index acdd45e82..2fd6e9766 100644
--- a/src/patch_parse.c
+++ b/src/patch_parse.c
@@ -98,7 +98,7 @@ static int parse_header_git_oldpath(
patch->old_path = git_buf_detach(&old_path);
out:
- git_buf_free(&old_path);
+ git_buf_dispose(&old_path);
return error;
}
@@ -114,7 +114,7 @@ static int parse_header_git_newpath(
patch->new_path = git_buf_detach(&new_path);
out:
- git_buf_free(&new_path);
+ git_buf_dispose(&new_path);
return error;
}
@@ -770,8 +770,8 @@ static int parse_patch_binary_side(
binary->data = git_buf_detach(&decoded);
done:
- git_buf_free(&base85);
- git_buf_free(&decoded);
+ git_buf_dispose(&base85);
+ git_buf_dispose(&decoded);
return error;
}
diff --git a/src/path.c b/src/path.c
index 77833eeaf..e411f356f 100644
--- a/src/path.c
+++ b/src/path.c
@@ -207,7 +207,7 @@ char *git_path_dirname(const char *path)
git_path_dirname_r(&buf, path);
dirname = git_buf_detach(&buf);
- git_buf_free(&buf); /* avoid memleak if error occurs */
+ git_buf_dispose(&buf); /* avoid memleak if error occurs */
return dirname;
}
@@ -219,7 +219,7 @@ char *git_path_basename(const char *path)
git_path_basename_r(&buf, path);
basename = git_buf_detach(&buf);
- git_buf_free(&buf); /* avoid memleak if error occurs */
+ git_buf_dispose(&buf); /* avoid memleak if error occurs */
return basename;
}
@@ -642,7 +642,7 @@ bool git_path_is_empty_dir(const char *path)
else
error = git_path_direach(&dir, 0, path_found_entry, NULL);
- git_buf_free(&dir);
+ git_buf_dispose(&dir);
return !error;
}
@@ -956,7 +956,7 @@ void git_path_iconv_clear(git_path_iconv_t *ic)
if (ic) {
if (ic->map != (iconv_t)-1)
iconv_close(ic->map);
- git_buf_free(&ic->buf);
+ git_buf_dispose(&ic->buf);
}
}
@@ -1060,7 +1060,7 @@ bool git_path_does_fs_decompose_unicode(const char *root)
(void)p_unlink(path.ptr);
done:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return found_decomposed;
}
@@ -1308,7 +1308,7 @@ void git_path_diriter_free(git_path_diriter *diriter)
if (diriter == NULL)
return;
- git_buf_free(&diriter->path_utf8);
+ git_buf_dispose(&diriter->path_utf8);
if (diriter->handle != INVALID_HANDLE_VALUE) {
FindClose(diriter->handle);
@@ -1338,7 +1338,7 @@ int git_path_diriter_init(
}
if ((diriter->dir = opendir(diriter->path.ptr)) == NULL) {
- git_buf_free(&diriter->path);
+ git_buf_dispose(&diriter->path);
giterr_set(GITERR_OS, "failed to open directory '%s'", path);
return -1;
@@ -1448,7 +1448,7 @@ void git_path_diriter_free(git_path_diriter *diriter)
git_path_iconv_clear(&diriter->ic);
#endif
- git_buf_free(&diriter->path);
+ git_buf_dispose(&diriter->path);
}
#endif
diff --git a/src/pathspec.c b/src/pathspec.c
index 998b6fb36..3415f66e5 100644
--- a/src/pathspec.c
+++ b/src/pathspec.c
@@ -36,7 +36,7 @@ char *git_pathspec_prefix(const git_strarray *pathspec)
git_buf_truncate(&prefix, scan - prefix.ptr);
if (prefix.size <= 0) {
- git_buf_free(&prefix);
+ git_buf_dispose(&prefix);
return NULL;
}
diff --git a/src/push.c b/src/push.c
index 85b683e62..ab6042883 100644
--- a/src/push.c
+++ b/src/push.c
@@ -228,7 +228,7 @@ int git_push_update_tips(git_push *push, const git_remote_callbacks *callbacks)
error = 0;
on_error:
- git_buf_free(&remote_ref_name);
+ git_buf_dispose(&remote_ref_name);
return error;
}
diff --git a/src/rebase.c b/src/rebase.c
index f1cb22f3f..bc3c5995c 100644
--- a/src/rebase.c
+++ b/src/rebase.c
@@ -116,7 +116,7 @@ done:
if (type != GIT_REBASE_TYPE_NONE && path_out)
*path_out = git_buf_detach(&path);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return 0;
}
@@ -251,9 +251,9 @@ static int rebase_open_merge(git_rebase *rebase)
rebase->onto_name = git_buf_detach(&buf);
done:
- git_buf_free(&cmt);
- git_buf_free(&state_path);
- git_buf_free(&buf);
+ git_buf_dispose(&cmt);
+ git_buf_dispose(&state_path);
+ git_buf_dispose(&buf);
return error;
}
@@ -390,10 +390,10 @@ done:
else
git_rebase_free(rebase);
- git_buf_free(&path);
- git_buf_free(&orig_head_name);
- git_buf_free(&orig_head_id);
- git_buf_free(&onto_id);
+ git_buf_dispose(&path);
+ git_buf_dispose(&orig_head_name);
+ git_buf_dispose(&orig_head_id);
+ git_buf_dispose(&onto_id);
return error;
}
@@ -421,8 +421,8 @@ static int rebase_setupfile(git_rebase *rebase, const char *filename, int flags,
if ((error = git_buf_joinpath(&path, rebase->state_path, filename)) == 0)
error = git_futils_writebuffer(&contents, path.ptr, flags, REBASE_FILE_MODE);
- git_buf_free(&path);
- git_buf_free(&contents);
+ git_buf_dispose(&path);
+ git_buf_dispose(&contents);
return error;
}
@@ -463,7 +463,7 @@ static int rebase_setupfiles_merge(git_rebase *rebase)
}
done:
- git_buf_free(&commit_filename);
+ git_buf_dispose(&commit_filename);
return error;
}
@@ -659,8 +659,8 @@ static int rebase_init_merge(
done:
git_reference_free(head_ref);
git_commit_free(onto_commit);
- git_buf_free(&reflog);
- git_buf_free(&state_path);
+ git_buf_dispose(&reflog);
+ git_buf_dispose(&state_path);
return error;
}
@@ -839,7 +839,7 @@ done:
git_tree_free(parent_tree);
git_commit_free(parent_commit);
git_commit_free(current_commit);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -1263,9 +1263,9 @@ on_error:
error = -1;
done:
- git_buf_free(&rewritten);
- git_buf_free(&path);
- git_buf_free(&notes_ref);
+ git_buf_dispose(&rewritten);
+ git_buf_dispose(&path);
+ git_buf_dispose(&notes_ref);
return error;
}
@@ -1297,8 +1297,8 @@ static int return_to_orig_head(git_rebase *rebase)
rebase->repo, GIT_HEAD_FILE, rebase->orig_head_name, 1,
head_msg.ptr);
- git_buf_free(&head_msg);
- git_buf_free(&branch_msg);
+ git_buf_dispose(&head_msg);
+ git_buf_dispose(&branch_msg);
git_commit_free(terminal_commit);
git_reference_free(head_ref);
git_reference_free(branch_ref);
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index 0b4bbb408..49b567c08 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -183,7 +183,7 @@ static int packed_reload(refdb_fs_backend *backend)
}
git_sortedcache_wunlock(backend->refcache);
- git_buf_free(&packedrefs);
+ git_buf_dispose(&packedrefs);
return 0;
@@ -192,7 +192,7 @@ parse_failed:
git_sortedcache_clear(backend->refcache, false);
git_sortedcache_wunlock(backend->refcache);
- git_buf_free(&packedrefs);
+ git_buf_dispose(&packedrefs);
return -1;
}
@@ -226,7 +226,7 @@ static int loose_readbuffer(git_buf *buf, const char *base, const char *path)
/* build full path to file */
if ((error = git_buf_joinpath(buf, base, path)) < 0 ||
(error = git_futils_readbuffer(buf, buf->ptr)) < 0)
- git_buf_free(buf);
+ git_buf_dispose(buf);
return error;
}
@@ -266,7 +266,7 @@ static int loose_lookup_to_packfile(refdb_fs_backend *backend, const char *name)
git_sortedcache_wunlock(backend->refcache);
done:
- git_buf_free(&ref_file);
+ git_buf_dispose(&ref_file);
return error;
}
@@ -317,7 +317,7 @@ static int packed_loadloose(refdb_fs_backend *backend)
error = git_path_direach(
&refs_path, backend->direach_flags, _dirent_loose_load, backend);
- git_buf_free(&refs_path);
+ git_buf_dispose(&refs_path);
return error;
}
@@ -340,7 +340,7 @@ static int refdb_fs_backend__exists(
*exists = git_path_isfile(ref_path.ptr) ||
(git_sortedcache_lookup(backend->refcache, ref_name) != NULL);
- git_buf_free(&ref_path);
+ git_buf_dispose(&ref_path);
return 0;
}
@@ -414,7 +414,7 @@ static int loose_lookup(
*out = git_reference__alloc(ref_name, &oid, NULL);
}
- git_buf_free(&ref_file);
+ git_buf_dispose(&ref_file);
return error;
}
@@ -539,12 +539,12 @@ static int iter_load_loose_paths(refdb_fs_backend *backend, refdb_fs_iter *iter)
if ((error = git_buf_printf(&path, "%s/", backend->commonpath)) < 0 ||
(error = git_buf_put(&path, ref_prefix, ref_prefix_len)) < 0) {
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
if ((error = git_iterator_for_filesystem(&fsit, path.ptr, &fsit_opts)) < 0) {
- git_buf_free(&path);
+ git_buf_dispose(&path);
return (iter->glob && error == GIT_ENOTFOUND)? 0 : error;
}
@@ -577,7 +577,7 @@ static int iter_load_loose_paths(refdb_fs_backend *backend, refdb_fs_iter *iter)
}
git_iterator_free(fsit);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -803,7 +803,7 @@ static int loose_lock(git_filebuf *file, refdb_fs_backend *backend, const char *
if (error == GIT_EDIRECTORY)
giterr_set(GITERR_REFERENCE, "cannot lock ref '%s', there are refs beneath that folder", name);
- git_buf_free(&ref_path);
+ git_buf_dispose(&ref_path);
return error;
}
@@ -990,7 +990,7 @@ static int packed_remove_loose(refdb_fs_backend *backend)
continue;
if (error < 0) {
- git_buf_free(&ref_content);
+ git_buf_dispose(&ref_content);
giterr_set(GITERR_REFERENCE, "failed to lock loose reference '%s'", ref->name);
return error;
}
@@ -1021,7 +1021,7 @@ static int packed_remove_loose(refdb_fs_backend *backend)
p_unlink(lock.path_original);
}
- git_buf_free(&ref_content);
+ git_buf_dispose(&ref_content);
git_filebuf_cleanup(&lock);
return 0;
}
@@ -1383,7 +1383,7 @@ static int refdb_fs_backend__delete_tail(
error = packed_write(backend);
cleanup:
- git_buf_free(&loose_path);
+ git_buf_dispose(&loose_path);
git_filebuf_cleanup(file);
return error;
@@ -1522,7 +1522,7 @@ static char *setup_namespace(git_repository *repo, const char *in)
out = git_buf_detach(&path);
done:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return out;
}
@@ -1655,7 +1655,7 @@ static int refdb_reflog_fs__ensure_log(git_refdb_backend *_backend, const char *
return error;
error = create_new_reflog_file(git_buf_cstr(&path));
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -1671,7 +1671,7 @@ static int has_reflog(git_repository *repo, const char *name)
ret = git_path_isfile(git_buf_cstr(&path));
cleanup:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return ret;
}
@@ -1725,8 +1725,8 @@ cleanup:
git_reflog_free(log);
success:
- git_buf_free(&log_file);
- git_buf_free(&log_path);
+ git_buf_dispose(&log_file);
+ git_buf_dispose(&log_path);
return error;
}
@@ -1791,7 +1791,7 @@ static int lock_reflog(git_filebuf *file, refdb_fs_backend *backend, const char
error = git_filebuf_open(file, git_buf_cstr(&log_path), 0, GIT_REFLOG_FILE_MODE);
cleanup:
- git_buf_free(&log_path);
+ git_buf_dispose(&log_path);
return error;
}
@@ -1827,7 +1827,7 @@ cleanup:
git_filebuf_cleanup(&fbuf);
success:
- git_buf_free(&log);
+ git_buf_dispose(&log);
return error;
}
@@ -1911,8 +1911,8 @@ static int reflog_append(refdb_fs_backend *backend, const git_reference *ref, co
error = git_futils_writebuffer(&buf, git_buf_cstr(&path), open_flags, GIT_REFLOG_FILE_MODE);
cleanup:
- git_buf_free(&buf);
- git_buf_free(&path);
+ git_buf_dispose(&buf);
+ git_buf_dispose(&path);
return error;
}
@@ -1990,10 +1990,10 @@ static int refdb_reflog_fs__rename(git_refdb_backend *_backend, const char *old_
}
cleanup:
- git_buf_free(&temp_path);
- git_buf_free(&old_path);
- git_buf_free(&new_path);
- git_buf_free(&normalized);
+ git_buf_dispose(&temp_path);
+ git_buf_dispose(&old_path);
+ git_buf_dispose(&new_path);
+ git_buf_dispose(&normalized);
return error;
}
@@ -2016,7 +2016,7 @@ static int refdb_reflog_fs__delete(git_refdb_backend *_backend, const char *name
if (!error && git_path_exists(path.ptr))
error = p_unlink(path.ptr);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
@@ -2055,7 +2055,7 @@ int git_refdb_backend_fs(
NULL, NULL, packref_cmp, git_buf_cstr(&gitpath)) < 0)
goto fail;
- git_buf_free(&gitpath);
+ git_buf_dispose(&gitpath);
if (!git_repository__cvar(&t, backend->repo, GIT_CVAR_IGNORECASE) && t) {
backend->iterator_flags |= GIT_ITERATOR_IGNORE_CASE;
@@ -2091,7 +2091,7 @@ int git_refdb_backend_fs(
return 0;
fail:
- git_buf_free(&gitpath);
+ git_buf_dispose(&gitpath);
git__free(backend->gitpath);
git__free(backend->commonpath);
git__free(backend);
diff --git a/src/refs.c b/src/refs.c
index c42968359..b3e94d8e8 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -282,7 +282,7 @@ int git_reference__read_head(
out:
git__free(name);
- git_buf_free(&reference);
+ git_buf_dispose(&reference);
return error;
}
@@ -346,8 +346,8 @@ cleanup:
if (error == GIT_ENOTFOUND)
giterr_set(GITERR_REFERENCE, "no reference found for shorthand '%s'", refname);
- git_buf_free(&name);
- git_buf_free(&refnamebuf);
+ git_buf_dispose(&name);
+ git_buf_dispose(&refnamebuf);
return error;
}
@@ -1076,7 +1076,7 @@ cleanup:
"the given reference name '%s' is not valid", name);
if (error && normalize)
- git_buf_free(buf);
+ git_buf_dispose(buf);
#ifdef GIT_USE_ICONV
git_path_iconv_clear(&ic);
@@ -1110,7 +1110,7 @@ int git_reference_normalize_name(
error = 0;
cleanup:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -1262,7 +1262,7 @@ int git_reference__update_for_commit(
done:
git_reference_free(ref_new);
- git_buf_free(&reflog_msg);
+ git_buf_dispose(&reflog_msg);
git_commit_free(commit);
return error;
}
diff --git a/src/refspec.c b/src/refspec.c
index 943a9c76a..8061788d1 100644
--- a/src/refspec.c
+++ b/src/refspec.c
@@ -359,7 +359,7 @@ int git_refspec__dwim_one(git_vector *out, git_refspec *spec, git_vector *refs)
cur->dst = git_buf_detach(&buf);
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (cur->dst == NULL && spec->dst != NULL) {
cur->dst = git__strdup(spec->dst);
diff --git a/src/remote.c b/src/remote.c
index d8a6b991d..8b1d2dacd 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -67,7 +67,7 @@ static int download_tags_value(git_remote *remote, git_config *cfg)
return -1;
error = git_config__lookup_entry(&ce, cfg, git_buf_cstr(&buf), false);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (!error && ce && ce->value) {
if (!strcmp(ce->value, "--no-tags"))
@@ -132,7 +132,7 @@ static int write_add_refspec(git_repository *repo, const char *name, const char
}
cleanup:
- git_buf_free(&var);
+ git_buf_dispose(&var);
return 0;
}
@@ -255,7 +255,7 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n
remote->download_tags = GIT_REMOTE_DOWNLOAD_TAGS_AUTO;
- git_buf_free(&var);
+ git_buf_dispose(&var);
*out = remote;
error = 0;
@@ -265,8 +265,8 @@ on_error:
git_remote_free(remote);
git_config_free(config_ro);
- git_buf_free(&canonical_url);
- git_buf_free(&var);
+ git_buf_dispose(&canonical_url);
+ git_buf_dispose(&var);
return error;
}
@@ -302,7 +302,7 @@ int git_remote_create(git_remote **out, git_repository *repo, const char *name,
return -1;
error = git_remote_create_with_fetchspec(out, repo, name, url, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -524,7 +524,7 @@ int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
cleanup:
git_config_free(config);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error < 0)
git_remote_free(remote);
@@ -552,7 +552,7 @@ static int lookup_remote_prune_config(git_remote *remote, git_config *config, co
}
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -601,8 +601,8 @@ static int set_url(git_repository *repo, const char *remote, const char *pattern
}
cleanup:
- git_buf_free(&canonical_url);
- git_buf_free(&buf);
+ git_buf_dispose(&canonical_url);
+ git_buf_dispose(&buf);
return error;
}
@@ -761,7 +761,7 @@ int git_remote__get_http_proxy(git_remote *remote, bool use_ssl, char **proxy_ur
return error;
error = git_config__lookup_entry(&ce, cfg, git_buf_cstr(&buf), false);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error < 0)
return error;
@@ -985,7 +985,7 @@ int git_remote_fetch(
/* Create "remote/foo" branches for all remote branches */
error = git_remote_update_tips(remote, cbs, update_fetchhead, tagopt, git_buf_cstr(&reflog_msg_buf));
- git_buf_free(&reflog_msg_buf);
+ git_buf_dispose(&reflog_msg_buf);
if (error < 0)
return error;
@@ -1050,8 +1050,8 @@ static int ref_to_update(int *update, git_buf *remote_name, git_remote *remote,
*update = 1;
}
- git_buf_free(&upstream_remote);
- git_buf_free(&upstream_name);
+ git_buf_dispose(&upstream_remote);
+ git_buf_dispose(&upstream_name);
return error;
}
@@ -1084,7 +1084,7 @@ static int remote_head_for_ref(git_remote_head **out, git_remote *remote, git_re
error = remote_head_for_fetchspec_src(out, update_heads, git_buf_cstr(&remote_name));
cleanup:
- git_buf_free(&remote_name);
+ git_buf_dispose(&remote_name);
git_reference_free(resolved_ref);
git_config_free(config);
return error;
@@ -1235,7 +1235,7 @@ int git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks)
key.name = (char *) git_buf_cstr(&buf);
error = git_vector_search(&pos, &remote_refs, &key);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error < 0 && error != GIT_ENOTFOUND)
goto cleanup;
@@ -1417,13 +1417,13 @@ static int update_tips_for_spec(
git_vector_free(&update_heads);
git_refspec__free(&tagspec);
- git_buf_free(&refname);
+ git_buf_dispose(&refname);
return 0;
on_error:
git_vector_free(&update_heads);
git_refspec__free(&tagspec);
- git_buf_free(&refname);
+ git_buf_dispose(&refname);
return -1;
}
@@ -1537,7 +1537,7 @@ static int opportunistic_updates(const git_remote *remote, const git_remote_call
error = 0;
cleanup:
- git_buf_free(&refname);
+ git_buf_dispose(&refname);
return error;
}
@@ -1550,7 +1550,7 @@ static int truncate_fetch_head(const char *gitdir)
return error;
error = git_futils_truncate(path.ptr, GIT_REFS_FILE_MODE);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -1759,7 +1759,7 @@ int git_remote_set_autotag(git_repository *repo, const char *remote, git_remote_
error = -1;
}
- git_buf_free(&var);
+ git_buf_dispose(&var);
return error;
}
@@ -1790,8 +1790,8 @@ static int rename_remote_config_section(
new_name ? git_buf_cstr(&new_section_name) : NULL);
cleanup:
- git_buf_free(&old_section_name);
- git_buf_free(&new_section_name);
+ git_buf_dispose(&old_section_name);
+ git_buf_dispose(&new_section_name);
return error;
}
@@ -1887,10 +1887,10 @@ static int rename_one_remote_reference(
cleanup:
git_reference_free(reference_in);
git_reference_free(ref);
- git_buf_free(&namespace);
- git_buf_free(&old_namespace);
- git_buf_free(&new_name);
- git_buf_free(&log_message);
+ git_buf_dispose(&namespace);
+ git_buf_dispose(&old_namespace);
+ git_buf_dispose(&new_name);
+ git_buf_dispose(&log_message);
return error;
}
@@ -1908,7 +1908,7 @@ static int rename_remote_references(
return error;
error = git_reference_iterator_glob_new(&iter, repo, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error < 0)
return error;
@@ -1976,9 +1976,9 @@ static int rename_fetch_refspecs(git_vector *problems, git_remote *remote, const
break;
}
- git_buf_free(&base);
- git_buf_free(&var);
- git_buf_free(&val);
+ git_buf_dispose(&base);
+ git_buf_dispose(&var);
+ git_buf_dispose(&val);
if (error < 0) {
char *str;
@@ -2044,7 +2044,7 @@ int git_remote_is_valid_name(
git_buf_printf(&buf, "refs/heads/test:refs/remotes/%s/test", remote_name);
error = git_refspec__parse(&refspec, git_buf_cstr(&buf), true);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_refspec__free(&refspec);
giterr_clear();
@@ -2219,7 +2219,7 @@ static int remove_branch_config_related_entries(
if (error == GIT_ITEROVER)
error = 0;
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_iterator_free(iter);
return error;
}
diff --git a/src/repository.c b/src/repository.c
index 3c8987990..a2f88a283 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -166,7 +166,7 @@ void git_repository_free(git_repository *repo)
repo->diff_drivers = NULL;
for (i = 0; i < repo->reserved_names.size; i++)
- git_buf_free(git_array_get(repo->reserved_names, i));
+ git_buf_dispose(git_array_get(repo->reserved_names, i));
git_array_clear(repo->reserved_names);
git__free(repo->gitlink);
@@ -203,7 +203,7 @@ static bool valid_repository_path(git_buf *repository_path, git_buf *common_path
git_buf_swap(common_path, &common_link);
}
- git_buf_free(&common_link);
+ git_buf_dispose(&common_link);
}
else {
git_buf_set(common_path, repository_path->ptr, repository_path->size);
@@ -333,7 +333,7 @@ static int load_workdir(git_repository *repo, git_config *config, git_buf *paren
GITERR_CHECK_ALLOC(repo->workdir);
cleanup:
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_config_entry_free(ce);
return error;
}
@@ -425,7 +425,7 @@ static int read_gitfile(git_buf *path_out, const char *file_path)
path_out, gitlink, git_buf_cstr(path_out));
}
- git_buf_free(&file);
+ git_buf_dispose(&file);
return error;
}
@@ -556,9 +556,9 @@ static int find_repo(
error = GIT_ENOTFOUND;
}
- git_buf_free(&path);
- git_buf_free(&repo_link);
- git_buf_free(&common_link);
+ git_buf_dispose(&path);
+ git_buf_dispose(&repo_link);
+ git_buf_dispose(&common_link);
return error;
}
@@ -574,8 +574,8 @@ int git_repository_open_bare(
return error;
if (!valid_repository_path(&path, &common_path)) {
- git_buf_free(&path);
- git_buf_free(&common_path);
+ git_buf_dispose(&path);
+ git_buf_dispose(&common_path);
giterr_set(GITERR_REPOSITORY, "path is not a repository: %s", bare_path);
return GIT_ENOTFOUND;
}
@@ -754,15 +754,15 @@ error:
success:
git_odb_free(odb);
git_index_free(index);
- git_buf_free(&common_dir_buf);
- git_buf_free(&work_tree_buf);
- git_buf_free(&alts_buf);
- git_buf_free(&object_dir_buf);
- git_buf_free(&namespace_buf);
- git_buf_free(&index_file_buf);
- git_buf_free(&across_fs_buf);
- git_buf_free(&ceiling_dirs_buf);
- git_buf_free(&dir_buf);
+ git_buf_dispose(&common_dir_buf);
+ git_buf_dispose(&work_tree_buf);
+ git_buf_dispose(&alts_buf);
+ git_buf_dispose(&object_dir_buf);
+ git_buf_dispose(&namespace_buf);
+ git_buf_dispose(&index_file_buf);
+ git_buf_dispose(&across_fs_buf);
+ git_buf_dispose(&ceiling_dirs_buf);
+ git_buf_dispose(&dir_buf);
return error;
}
@@ -785,7 +785,7 @@ static int repo_is_worktree(unsigned *out, const git_repository *repo)
* only used when the repository is a working tree. */
*out = !!git_path_exists(gitdir_link.ptr);
- git_buf_free(&gitdir_link);
+ git_buf_dispose(&gitdir_link);
return error;
}
@@ -856,8 +856,8 @@ int git_repository_open_ext(
}
cleanup:
- git_buf_free(&gitdir);
- git_buf_free(&workdir);
+ git_buf_dispose(&gitdir);
+ git_buf_dispose(&workdir);
git_config_free(config);
if (error < 0)
@@ -899,7 +899,7 @@ int git_repository_open_from_worktree(git_repository **repo_out, git_worktree *w
*repo_out = repo;
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return err;
}
@@ -955,7 +955,7 @@ static int load_config(
if (error && error != GIT_ENOTFOUND)
goto on_error;
- git_buf_free(&config_path);
+ git_buf_dispose(&config_path);
if (global_config_path != NULL &&
(error = git_config_add_file_ondisk(
@@ -987,7 +987,7 @@ static int load_config(
return 0;
on_error:
- git_buf_free(&config_path);
+ git_buf_dispose(&config_path);
git_config_free(cfg);
*out = NULL;
return error;
@@ -1034,10 +1034,10 @@ int git_repository_config__weakptr(git_config **out, git_repository *repo)
}
}
- git_buf_free(&global_buf);
- git_buf_free(&xdg_buf);
- git_buf_free(&system_buf);
- git_buf_free(&programdata_buf);
+ git_buf_dispose(&global_buf);
+ git_buf_dispose(&xdg_buf);
+ git_buf_dispose(&system_buf);
+ git_buf_dispose(&programdata_buf);
}
*out = repo->_config;
@@ -1099,7 +1099,7 @@ int git_repository_odb__weakptr(git_odb **out, git_repository *repo)
git_odb_free(odb);
}
- git_buf_free(&odb_path);
+ git_buf_dispose(&odb_path);
}
*out = repo->_odb;
@@ -1187,7 +1187,7 @@ int git_repository_index__weakptr(git_index **out, git_repository *repo)
error = git_index_set_caps(repo->_index, GIT_INDEXCAP_FROM_OWNER);
}
- git_buf_free(&index_path);
+ git_buf_dispose(&index_path);
}
*out = repo->_index;
@@ -1372,11 +1372,11 @@ int git_repository_create_head(const char *git_dir, const char *ref_name)
git_filebuf_commit(&ref) < 0)
goto fail;
- git_buf_free(&ref_path);
+ git_buf_dispose(&ref_path);
return 0;
fail:
- git_buf_free(&ref_path);
+ git_buf_dispose(&ref_path);
git_filebuf_cleanup(&ref);
return -1;
}
@@ -1405,7 +1405,7 @@ static bool is_filesystem_case_insensitive(const char *gitdir_path)
if (!git_buf_joinpath(&path, gitdir_path, "CoNfIg"))
is_insensitive = git_path_exists(git_buf_cstr(&path));
- git_buf_free(&path);
+ git_buf_dispose(&path);
return is_insensitive;
}
@@ -1426,7 +1426,7 @@ static bool are_symlinks_supported(const char *wd_path)
symlinks_supported = (S_ISLNK(st.st_mode) != 0);
(void)p_unlink(path.ptr);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return symlinks_supported;
}
@@ -1586,8 +1586,8 @@ static int repo_init_config(
}
cleanup:
- git_buf_free(&cfg_path);
- git_buf_free(&worktree_path);
+ git_buf_dispose(&cfg_path);
+ git_buf_dispose(&worktree_path);
git_config_free(config);
return error;
@@ -1618,7 +1618,7 @@ int git_repository_reinit_filesystem(git_repository *repo, int recurse)
config, path.ptr, repo_dir, git_repository_workdir(repo), true);
git_config_free(config);
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_repository__cvar_cache_clear(repo);
@@ -1666,7 +1666,7 @@ static int repo_write_template(
GIT_UNUSED(hidden);
#endif
- git_buf_free(&path);
+ git_buf_dispose(&path);
if (error)
giterr_set(GITERR_OS,
@@ -1720,8 +1720,8 @@ static int repo_write_gitlink(
error = repo_write_template(in_dir, true, DOT_GIT, 0666, true, buf.ptr);
cleanup:
- git_buf_free(&buf);
- git_buf_free(&path_to_repo);
+ git_buf_dispose(&buf);
+ git_buf_dispose(&path_to_repo);
return error;
}
@@ -1805,7 +1805,7 @@ static int repo_init_structure(
error = git_futils_cp_r(tdir, repo_dir, cpflags, dmode);
}
- git_buf_free(&template_buf);
+ git_buf_dispose(&template_buf);
git_config_free(cfg);
if (error < 0) {
@@ -2065,9 +2065,9 @@ int git_repository_init_ext(
error = repo_init_create_origin(*out, opts->origin_url);
cleanup:
- git_buf_free(&common_path);
- git_buf_free(&repo_path);
- git_buf_free(&wd_path);
+ git_buf_dispose(&common_path);
+ git_buf_dispose(&repo_path);
+ git_buf_dispose(&wd_path);
return error;
}
@@ -2165,7 +2165,7 @@ out:
if (error)
git_reference_free(head);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -2197,7 +2197,7 @@ int git_repository_foreach_head(git_repository *repo, git_repository_foreach_hea
}
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_strarray_free(&worktrees);
return error;
}
@@ -2440,7 +2440,7 @@ int git_repository__set_orig_head(git_repository *repo, const git_oid *orig_head
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
@@ -2464,7 +2464,7 @@ int git_repository_message(git_buf *out, git_repository *repo)
error = git_futils_readbuffer(out, git_buf_cstr(&path));
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -2478,7 +2478,7 @@ int git_repository_message_remove(git_repository *repo)
return -1;
error = p_unlink(git_buf_cstr(&path));
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -2548,7 +2548,7 @@ cleanup:
if (fd >= 0)
p_close(fd);
git_filter_list_free(fl);
- git_buf_free(&full_path);
+ git_buf_dispose(&full_path);
return error;
}
@@ -2604,7 +2604,7 @@ static int detach(git_repository *repo, const git_oid *id, const char *new)
error = git_reference_create(&new_head, repo, GIT_HEAD_FILE, git_object_id(peeled), true, git_buf_cstr(&log_message));
cleanup:
- git_buf_free(&log_message);
+ git_buf_dispose(&log_message);
git_object_free(object);
git_object_free(peeled);
git_reference_free(current);
@@ -2654,7 +2654,7 @@ int git_repository_set_head(
}
cleanup:
- git_buf_free(&log_message);
+ git_buf_dispose(&log_message);
git_reference_free(current);
git_reference_free(ref);
git_reference_free(new_head);
@@ -2702,7 +2702,7 @@ int git_repository_detach_head(git_repository* repo)
1, git_buf_cstr(&log_message));
cleanup:
- git_buf_free(&log_message);
+ git_buf_dispose(&log_message);
git_object_free(object);
git_reference_free(old_head);
git_reference_free(new_head);
@@ -2749,7 +2749,7 @@ int git_repository_state(git_repository *repo)
} else if (git_path_contains_file(&repo_path, GIT_BISECT_LOG_FILE))
state = GIT_REPOSITORY_STATE_BISECT;
- git_buf_free(&repo_path);
+ git_buf_dispose(&repo_path);
return state;
}
@@ -2778,7 +2778,7 @@ int git_repository__cleanup_files(
git_buf_clear(&buf);
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -2811,7 +2811,7 @@ int git_repository_is_shallow(git_repository *repo)
return error;
error = git_path_lstat(path.ptr, &st);
- git_buf_free(&path);
+ git_buf_dispose(&path);
if (error == GIT_ENOTFOUND) {
giterr_clear();
diff --git a/src/reset.c b/src/reset.c
index 21596812f..01b0b212f 100644
--- a/src/reset.c
+++ b/src/reset.c
@@ -176,7 +176,7 @@ cleanup:
git_object_free(commit);
git_index_free(index);
git_tree_free(tree);
- git_buf_free(&log_message);
+ git_buf_dispose(&log_message);
return error;
}
diff --git a/src/revert.c b/src/revert.c
index 54f6d48e4..e4cbcf507 100644
--- a/src/revert.c
+++ b/src/revert.c
@@ -36,7 +36,7 @@ static int write_revert_head(
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
@@ -62,7 +62,7 @@ cleanup:
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
@@ -219,7 +219,7 @@ done:
git_index_free(index);
git_commit_free(our_commit);
git_reference_free(our_ref);
- git_buf_free(&their_label);
+ git_buf_dispose(&their_label);
return error;
}
diff --git a/src/revparse.c b/src/revparse.c
index 7cb22f476..bdbf87558 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -197,7 +197,7 @@ static int retrieve_previously_checked_out_branch_or_revision(git_object **out,
cleanup:
git_reference_free(ref);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
regfree(&preg);
git_reflog_free(reflog);
return error;
@@ -350,7 +350,7 @@ static int handle_at_syntax(git_object **out, git_reference **ref, const char *s
error = retrieve_revobject_from_reflog(out, ref, repo, git_buf_cstr(&identifier), (size_t)timestamp);
cleanup:
- git_buf_free(&identifier);
+ git_buf_dispose(&identifier);
return error;
}
@@ -624,7 +624,7 @@ static int ensure_base_rev_loaded(git_object **object, git_reference **reference
return -1;
error = revparse_lookup_object(object, reference, repo, git_buf_cstr(&identifier));
- git_buf_free(&identifier);
+ git_buf_dispose(&identifier);
return error;
}
@@ -820,7 +820,7 @@ cleanup:
git_reference_free(reference);
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
diff --git a/src/revwalk.c b/src/revwalk.c
index eb228a522..e7bbc126e 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -152,7 +152,7 @@ static int push_glob(git_revwalk *walk, const char *glob, int hide)
if (error == GIT_ITEROVER)
error = 0;
out:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
diff --git a/src/stash.c b/src/stash.c
index 4b7e92af2..b85a5e720 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -149,7 +149,7 @@ static int commit_index(
cleanup:
git_tree_free(i_tree);
- git_buf_free(&msg);
+ git_buf_dispose(&msg);
return error;
}
@@ -291,7 +291,7 @@ static int commit_untracked(
cleanup:
git_tree_free(u_tree);
- git_buf_free(&msg);
+ git_buf_dispose(&msg);
return error;
}
@@ -423,7 +423,7 @@ static int prepare_worktree_commit_message(
error = (git_buf_oom(msg) || git_buf_oom(&buf)) ? -1 : 0;
cleanup:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -565,7 +565,7 @@ int git_stash_save(
cleanup:
- git_buf_free(&msg);
+ git_buf_dispose(&msg);
git_commit_free(i_commit);
git_commit_free(b_commit);
git_commit_free(u_commit);
diff --git a/src/submodule.c b/src/submodule.c
index d0aef2eeb..d0c7d04e6 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -190,7 +190,7 @@ static int is_path_occupied(bool *occupied, git_repository *repo, const char *pa
error = 0;
out:
- git_buf_free(&dir);
+ git_buf_dispose(&dir);
return error;
}
@@ -271,7 +271,7 @@ static int load_submodule_names(git_strmap **out, git_repository *repo, git_conf
out:
free_submodule_names(names);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_iterator_free(iter);
return error;
}
@@ -338,7 +338,7 @@ int git_submodule_lookup(
if (error < 0) {
git_submodule_free(sm);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -354,7 +354,7 @@ int git_submodule_lookup(
}
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
if ((error = git_submodule_location(&location, sm)) < 0) {
@@ -377,7 +377,7 @@ int git_submodule_lookup(
if (git_path_exists(path.ptr))
error = GIT_EEXISTS;
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
submodule_set_lookup_error(error, name);
@@ -409,7 +409,7 @@ int git_submodule_name_is_valid(git_repository *repo, const char *name, int flag
}
isvalid = git_path_isvalid(repo, buf.ptr, 0, flags);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return isvalid;
}
@@ -624,7 +624,7 @@ cleanup:
/* TODO: if we got an error, mark submodule config as invalid? */
git_index_free(idx);
git_tree_free(head);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -729,8 +729,8 @@ static int submodule_repo_init(
error = git_repository_init_ext(&subrepo, workdir.ptr, &initopt);
cleanup:
- git_buf_free(&workdir);
- git_buf_free(&repodir);
+ git_buf_dispose(&workdir);
+ git_buf_dispose(&repodir);
*out = subrepo;
@@ -835,8 +835,8 @@ cleanup:
git_config_file_free(mods);
git_repository_free(subrepo);
- git_buf_free(&real_url);
- git_buf_free(&name);
+ git_buf_dispose(&real_url);
+ git_buf_dispose(&name);
return error;
}
@@ -865,7 +865,7 @@ int git_submodule_repo_init(
done:
git_config_free(cfg);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -949,7 +949,7 @@ int git_submodule_add_to_index(git_submodule *sm, int write_index)
cleanup:
git_repository_free(sm_repo);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -1014,7 +1014,7 @@ int git_submodule_resolve_url(git_buf *out, git_repository *repo, const char *ur
error = -1;
}
- git_buf_free(&normalized);
+ git_buf_dispose(&normalized);
return error;
}
@@ -1036,7 +1036,7 @@ static int write_var(git_repository *repo, const char *name, const char *var, co
else
error = git_config_file_delete(mods, key.ptr);
- git_buf_free(&key);
+ git_buf_dispose(&key);
cleanup:
git_config_file_free(mods);
@@ -1201,8 +1201,8 @@ static int submodule_repo_create(
error = git_repository_init_ext(&subrepo, repodir.ptr, &initopt);
cleanup:
- git_buf_free(&workdir);
- git_buf_free(&repodir);
+ git_buf_dispose(&workdir);
+ git_buf_dispose(&repodir);
*out = subrepo;
@@ -1355,7 +1355,7 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio
}
done:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_free(config);
git_object_free(target_commit);
git_remote_free(remote);
@@ -1402,8 +1402,8 @@ int git_submodule_init(git_submodule *sm, int overwrite)
cleanup:
git_config_free(cfg);
- git_buf_free(&key);
- git_buf_free(&effective_submodule_url);
+ git_buf_dispose(&key);
+ git_buf_dispose(&effective_submodule_url);
return error;
}
@@ -1443,7 +1443,7 @@ int git_submodule_sync(git_submodule *sm)
} else {
error = git_buf_join3(
&key, '.', "remote", remote_name.ptr, "url");
- git_buf_free(&remote_name);
+ git_buf_dispose(&remote_name);
}
if (!error)
@@ -1452,7 +1452,7 @@ int git_submodule_sync(git_submodule *sm)
git_repository_free(smrepo);
}
- git_buf_free(&key);
+ git_buf_dispose(&key);
return error;
}
@@ -1506,7 +1506,7 @@ static int git_submodule__open(
sm->flags |= GIT_SUBMODULE_STATUS__WD_SCANNED;
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -1938,7 +1938,7 @@ static int submodule_read_config(git_submodule *sm, git_config *cfg)
error = 0;
cleanup:
- git_buf_free(&key);
+ git_buf_dispose(&key);
return error;
}
@@ -2000,7 +2000,7 @@ static int submodule_load_each(const git_config_entry *entry, void *payload)
error = 0;
done:
- git_buf_free(&name);
+ git_buf_dispose(&name);
return error;
}
@@ -2017,7 +2017,7 @@ static int submodule_load_from_wd_lite(git_submodule *sm)
if (git_path_contains(&path, DOT_GIT))
sm->flags |= GIT_SUBMODULE_STATUS_IN_WD;
- git_buf_free(&path);
+ git_buf_dispose(&path);
return 0;
}
@@ -2041,6 +2041,7 @@ static int gitmodules_snapshot(git_config **snap, git_repository *repo)
if ((error = git_config_open_ondisk(&mods, path.ptr)) < 0)
goto cleanup;
+ git_buf_dispose(&path);
if ((error = git_config_snapshot(snap, mods)) < 0)
goto cleanup;
@@ -2050,7 +2051,7 @@ static int gitmodules_snapshot(git_config **snap, git_repository *repo)
cleanup:
if (mods)
git_config_free(mods);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -2079,7 +2080,7 @@ static git_config_backend *open_gitmodules(
}
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
return mods;
}
@@ -2119,7 +2120,7 @@ static int lookup_head_remote_key(git_buf *remote_name, git_repository *repo)
goto done;
done:
- git_buf_free(&upstream_name);
+ git_buf_dispose(&upstream_name);
git_reference_free(head);
return error;
@@ -2135,7 +2136,7 @@ static int lookup_head_remote(git_remote **remote, git_repository *repo)
if (!(error = lookup_head_remote_key(&remote_name, repo)))
error = git_remote_lookup(remote, repo, remote_name.ptr);
- git_buf_free(&remote_name);
+ git_buf_dispose(&remote_name);
return error;
}
diff --git a/src/sysdir.c b/src/sysdir.c
index 509b23b82..5b1549e69 100644
--- a/src/sysdir.c
+++ b/src/sysdir.c
@@ -136,7 +136,7 @@ static int git_sysdir_guess_xdg_dirs(git_buf *out)
error = 0;
}
- git_buf_free(&env);
+ git_buf_dispose(&env);
return error;
#endif
}
@@ -168,7 +168,7 @@ static void git_sysdir_global_shutdown(void)
size_t i;
for (i = 0; i < ARRAY_SIZE(git_sysdir__dirs); ++i)
- git_buf_free(&git_sysdir__dirs[i].buf);
+ git_buf_dispose(&git_sysdir__dirs[i].buf);
}
int git_sysdir_global_init(void)
@@ -262,7 +262,7 @@ int git_sysdir_set(git_sysdir_t which, const char *search_path)
git_buf_join(&merge, GIT_PATH_LIST_SEPARATOR, merge.ptr, expand_path);
git_buf_swap(&git_sysdir__dirs[which].buf, &merge);
- git_buf_free(&merge);
+ git_buf_dispose(&merge);
done:
if (git_buf_oom(&git_sysdir__dirs[which].buf))
@@ -307,7 +307,7 @@ static int git_sysdir_find_in_dirlist(
}
done:
- git_buf_free(path);
+ git_buf_dispose(path);
giterr_set(GITERR_OS, "the %s file '%s' doesn't exist", label, name);
return GIT_ENOTFOUND;
}
diff --git a/src/tag.c b/src/tag.c
index 445c3ff1d..a7c55d0aa 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -229,11 +229,11 @@ static int write_tag_annotation(
if (git_odb_write(oid, odb, tag.ptr, tag.size, GIT_OBJ_TAG) < 0)
goto on_error;
- git_buf_free(&tag);
+ git_buf_dispose(&tag);
return 0;
on_error:
- git_buf_free(&tag);
+ git_buf_dispose(&tag);
giterr_set(GITERR_OBJECT, "failed to create tag annotation");
return -1;
}
@@ -268,7 +268,7 @@ static int git_tag_create__internal(
/** Ensure the tag name doesn't conflict with an already existing
* reference unless overwriting has explicitly been requested **/
if (error == 0 && !allow_ref_overwrite) {
- git_buf_free(&ref_name);
+ git_buf_dispose(&ref_name);
giterr_set(GITERR_TAG, "tag already exists");
return GIT_EEXISTS;
}
@@ -283,7 +283,7 @@ static int git_tag_create__internal(
cleanup:
git_reference_free(new_ref);
- git_buf_free(&ref_name);
+ git_buf_dispose(&ref_name);
return error;
}
@@ -381,7 +381,7 @@ int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *bu
git_odb_stream_free(stream);
if (error < 0) {
- git_buf_free(&ref_name);
+ git_buf_dispose(&ref_name);
return error;
}
@@ -389,7 +389,7 @@ int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *bu
&new_ref, repo, ref_name.ptr, oid, allow_ref_overwrite, NULL);
git_reference_free(new_ref);
- git_buf_free(&ref_name);
+ git_buf_dispose(&ref_name);
return error;
@@ -409,7 +409,7 @@ int git_tag_delete(git_repository *repo, const char *tag_name)
error = retrieve_tag_reference(&tag_ref, &ref_name, repo, tag_name);
- git_buf_free(&ref_name);
+ git_buf_dispose(&ref_name);
if (error < 0)
return error;
diff --git a/src/trace.h b/src/trace.h
index 498944035..1eaf6c92a 100644
--- a/src/trace.h
+++ b/src/trace.h
@@ -35,7 +35,7 @@ GIT_INLINE(void) git_trace__write_fmt(
callback(level, git_buf_cstr(&message));
- git_buf_free(&message);
+ git_buf_dispose(&message);
}
#define git_trace_level() (git_trace__data.level)
diff --git a/src/transport.c b/src/transport.c
index f1e18b323..bf13fe701 100644
--- a/src/transport.c
+++ b/src/transport.c
@@ -174,7 +174,7 @@ int git_transport_register(
return 0;
on_error:
- git_buf_free(&prefix);
+ git_buf_dispose(&prefix);
git__free(definition);
return error;
}
@@ -210,7 +210,7 @@ int git_transport_unregister(const char *scheme)
error = GIT_ENOTFOUND;
done:
- git_buf_free(&prefix);
+ git_buf_dispose(&prefix);
return error;
}
diff --git a/src/transports/auth.c b/src/transports/auth.c
index 9597cc249..c8e6adb12 100644
--- a/src/transports/auth.c
+++ b/src/transports/auth.c
@@ -40,7 +40,7 @@ on_error:
if (raw.size)
git__memzero(raw.ptr, raw.size);
- git_buf_free(&raw);
+ git_buf_dispose(&raw);
return error;
}
diff --git a/src/transports/auth_negotiate.c b/src/transports/auth_negotiate.c
index c9bc3043d..eeabe8a6d 100644
--- a/src/transports/auth_negotiate.c
+++ b/src/transports/auth_negotiate.c
@@ -165,7 +165,7 @@ static int negotiate_next_token(
done:
gss_release_name(&status_minor, &server);
gss_release_buffer(&status_minor, (gss_buffer_t) &output_token);
- git_buf_free(&input_buf);
+ git_buf_dispose(&input_buf);
return error;
}
@@ -180,7 +180,7 @@ static void negotiate_context_free(git_http_auth_context *c)
ctx->gss_context = GSS_C_NO_CONTEXT;
}
- git_buf_free(&ctx->target);
+ git_buf_dispose(&ctx->target);
git__free(ctx->challenge);
diff --git a/src/transports/git.c b/src/transports/git.c
index 94178f2c5..82a565fe9 100644
--- a/src/transports/git.c
+++ b/src/transports/git.c
@@ -87,7 +87,7 @@ static int send_command(git_proto_stream *s)
s->sent_command = 1;
cleanup:
- git_buf_free(&request);
+ git_buf_dispose(&request);
return error;
}
diff --git a/src/transports/http.c b/src/transports/http.c
index e051c8a35..ea3e57a49 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -449,14 +449,14 @@ static int on_headers_complete(http_parser *parser)
return t->parse_error = PARSE_ERROR_GENERIC;
if (strcmp(t->content_type, git_buf_cstr(&buf))) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
giterr_set(GITERR_NET,
"invalid Content-Type: %s",
t->content_type);
return t->parse_error = PARSE_ERROR_GENERIC;
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return 0;
}
@@ -508,10 +508,10 @@ static void clear_parser_state(http_subtransport *t)
t->parse_error = 0;
t->parse_finished = 0;
- git_buf_free(&t->parse_header_name);
+ git_buf_dispose(&t->parse_header_name);
git_buf_init(&t->parse_header_name, 0);
- git_buf_free(&t->parse_header_value);
+ git_buf_dispose(&t->parse_header_value);
git_buf_init(&t->parse_header_value, 0);
git__free(t->content_type);
@@ -534,11 +534,11 @@ static int write_chunk(git_stream *io, const char *buffer, size_t len)
return -1;
if (git_stream_write(io, buf.ptr, buf.size, 0) < 0) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return -1;
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* Chunk body */
if (len > 0 && git_stream_write(io, buffer, len, 0) < 0)
@@ -671,11 +671,11 @@ replay:
return -1;
if (git_stream_write(t->io, request.ptr, request.size, 0) < 0) {
- git_buf_free(&request);
+ git_buf_dispose(&request);
return -1;
}
- git_buf_free(&request);
+ git_buf_dispose(&request);
s->sent_request = 1;
}
@@ -792,11 +792,11 @@ static int http_stream_write_chunked(
return -1;
if (git_stream_write(t->io, request.ptr, request.size, 0) < 0) {
- git_buf_free(&request);
+ git_buf_dispose(&request);
return -1;
}
- git_buf_free(&request);
+ git_buf_dispose(&request);
s->sent_request = 1;
}
@@ -870,13 +870,13 @@ static int http_stream_write_single(
if (len && git_stream_write(t->io, buffer, len, 0) < 0)
goto on_error;
- git_buf_free(&request);
+ git_buf_dispose(&request);
s->sent_request = 1;
return 0;
on_error:
- git_buf_free(&request);
+ git_buf_dispose(&request);
return -1;
}
diff --git a/src/transports/local.c b/src/transports/local.c
index 541c552f6..b1522d1ec 100644
--- a/src/transports/local.c
+++ b/src/transports/local.c
@@ -228,14 +228,14 @@ static int local_connect(
/* 'url' may be a url or path; convert to a path */
if ((error = git_path_from_url_or_path(&buf, url)) < 0) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
path = git_buf_cstr(&buf);
error = git_repository_open(&repo, path);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error < 0)
return -1;
@@ -354,14 +354,14 @@ static int local_push(
/* 'push->remote->url' may be a url or path; convert to a path */
if ((error = git_path_from_url_or_path(&buf, push->remote->url)) < 0) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
path = git_buf_cstr(&buf);
error = git_repository_open(&remote_repo, path);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error < 0)
return error;
@@ -383,7 +383,7 @@ static int local_push(
goto on_error;
error = git_packbuilder_write(push->pb, odb_path.ptr, 0, transfer_to_push_transfer, (void *) cbs);
- git_buf_free(&odb_path);
+ git_buf_dispose(&odb_path);
if (error < 0)
goto on_error;
@@ -502,7 +502,7 @@ static int local_counting(int stage, unsigned int current, unsigned int total, v
return -1;
error = t->progress_cb(git_buf_cstr(&progress_info), git_buf_len(&progress_info), t->message_cb_payload);
- git_buf_free(&progress_info);
+ git_buf_dispose(&progress_info);
return error;
}
@@ -627,7 +627,7 @@ static int local_download_pack(
cleanup:
if (writepack) writepack->free(writepack);
- git_buf_free(&progress_info);
+ git_buf_dispose(&progress_info);
git_packbuilder_free(pack);
git_revwalk_free(walk);
return error;
diff --git a/src/transports/smart.c b/src/transports/smart.c
index 6d5d95fbf..79b5a3e6d 100644
--- a/src/transports/smart.c
+++ b/src/transports/smart.c
@@ -171,7 +171,7 @@ int git_smart__update_heads(transport_smart *t, git_vector *symrefs)
ref->head.symref_target = git_buf_detach(&buf);
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error < 0)
return error;
diff --git a/src/transports/smart_pkt.c b/src/transports/smart_pkt.c
index a661dfe13..48243305f 100644
--- a/src/transports/smart_pkt.c
+++ b/src/transports/smart_pkt.c
@@ -551,7 +551,7 @@ static int buffer_want_with_caps(const git_remote_head *head, transport_smart_ca
git_oid_fmt(oid, &head->oid);
git_buf_printf(buf,
"%04xwant %s %s\n", (unsigned int)len, oid, git_buf_cstr(&str));
- git_buf_free(&str);
+ git_buf_dispose(&str);
GITERR_CHECK_ALLOC_BUF(buf);
diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c
index ab52e04d4..8a094b698 100644
--- a/src/transports/smart_protocol.c
+++ b/src/transports/smart_protocol.c
@@ -106,7 +106,7 @@ static int append_symref(const char **out, git_vector *symrefs, const char *ptr)
GITERR_CHECK_ALLOC(mapping);
error = git_refspec__parse(mapping, git_buf_cstr(&buf), true);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* if the error isn't OOM, then it's a parse error; let's use a nicer message */
if (error < 0) {
@@ -465,7 +465,7 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c
if ((error = git_smart__negotiation_step(&t->parent, data.ptr, data.size)) < 0)
goto on_error;
- git_buf_free(&data);
+ git_buf_dispose(&data);
git_revwalk_free(walk);
/* Now let's eat up whatever the server gives us */
@@ -485,7 +485,7 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c
on_error:
git_revwalk_free(walk);
- git_buf_free(&data);
+ git_buf_dispose(&data);
return error;
}
@@ -862,7 +862,7 @@ static int parse_report(transport_smart *transport, git_push *push)
}
}
done:
- git_buf_free(&data_pkt_buf);
+ git_buf_dispose(&data_pkt_buf);
return error;
}
@@ -1085,6 +1085,6 @@ int git_smart__push(git_transport *transport, git_push *push, const git_remote_c
}
done:
- git_buf_free(&pktline);
+ git_buf_dispose(&pktline);
return error;
}
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index 23c643346..7d9114c26 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -121,7 +121,7 @@ static int send_command(ssh_stream *s)
s->sent_command = 1;
cleanup:
- git_buf_free(&request);
+ git_buf_dispose(&request);
return error;
}
diff --git a/src/transports/winhttp.c b/src/transports/winhttp.c
index e52d54b6d..4eb8b427a 100644
--- a/src/transports/winhttp.c
+++ b/src/transports/winhttp.c
@@ -455,7 +455,7 @@ static int winhttp_stream_connect(winhttp_stream *s)
/* Convert URL to wide characters */
error = git__utf8_to_16_alloc(&proxy_wide, processed_url.ptr);
- git_buf_free(&processed_url);
+ git_buf_dispose(&processed_url);
if (error < 0)
goto on_error;
@@ -599,7 +599,7 @@ on_error:
winhttp_stream_close(s);
git__free(proxy_url);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -659,12 +659,12 @@ static int write_chunk(HINTERNET request, const char *buffer, size_t len)
if (!WinHttpWriteData(request,
git_buf_cstr(&buf), (DWORD)git_buf_len(&buf),
&bytes_written)) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
giterr_set(GITERR_OS, "failed to write chunk header");
return -1;
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* Chunk body */
if (!WinHttpWriteData(request,
@@ -779,11 +779,11 @@ static int winhttp_connect(
if (git__utf8_to_16_alloc(&wide_ua, git_buf_cstr(&ua)) < 0) {
giterr_set(GITERR_OS, "unable to convert host to wide characters");
git__free(wide_host);
- git_buf_free(&ua);
+ git_buf_dispose(&ua);
return -1;
}
- git_buf_free(&ua);
+ git_buf_dispose(&ua);
/* Establish session */
t->session = WinHttpOpen(
diff --git a/src/tree.c b/src/tree.c
index 12622975a..2d7c91cdf 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -650,7 +650,7 @@ int git_tree__write_index(
}
ret = write_tree(oid, repo, index, "", 0, &shared_buf);
- git_buf_free(&shared_buf);
+ git_buf_dispose(&shared_buf);
if (old_ignore_case)
git_index__set_ignore_case(index, true);
@@ -814,7 +814,7 @@ int git_treebuilder_write(git_oid *oid, git_treebuilder *bld)
error = git_treebuilder_write_with_buffer(oid, bld, &buffer);
- git_buf_free(&buffer);
+ git_buf_dispose(&buffer);
return error;
}
@@ -1055,7 +1055,7 @@ int git_tree_walk(
error = tree_walk(
tree, callback, &root_path, payload, (mode == GIT_TREEWALK_PRE));
- git_buf_free(&root_path);
+ git_buf_dispose(&root_path);
return error;
}
@@ -1320,7 +1320,7 @@ cleanup:
}
}
- git_buf_free(&component);
+ git_buf_dispose(&component);
git_array_clear(stack);
git_vector_free(&entries);
return error;
diff --git a/src/win32/findfile.c b/src/win32/findfile.c
index d56aa1fd2..b5419bef0 100644
--- a/src/win32/findfile.c
+++ b/src/win32/findfile.c
@@ -158,7 +158,7 @@ static int win32_find_existing_dirs(
}
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return (git_buf_oom(out) ? -1 : 0);
}
@@ -185,7 +185,7 @@ int git_win32__find_system_dirs(git_buf *out, const wchar_t *subdir)
&buf, HKEY_LOCAL_MACHINE, REG_MSYSGIT_INSTALL, subdir) && buf.size)
git_buf_join(out, GIT_PATH_LIST_SEPARATOR, out->ptr, buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return (git_buf_oom(out) ? -1 : 0);
}
diff --git a/src/worktree.c b/src/worktree.c
index 48d3ef9ff..591df1c34 100644
--- a/src/worktree.c
+++ b/src/worktree.c
@@ -25,7 +25,7 @@ static bool is_worktree_dir(const char *dir)
&& git_path_contains_file(&buf, "gitdir")
&& git_path_contains_file(&buf, "HEAD");
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -64,7 +64,7 @@ int git_worktree_list(git_strarray *wts, git_repository *repo)
wts->strings = (char **)git_vector_detach(&wts->count, NULL, &worktrees);
exit:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -79,7 +79,7 @@ char *git_worktree__read_link(const char *base, const char *file)
goto err;
if (git_futils_readbuffer(&buf, path.ptr) < 0)
goto err;
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_buf_rtrim(&buf);
@@ -90,13 +90,13 @@ char *git_worktree__read_link(const char *base, const char *file)
goto err;
if (git_path_apply_relative(&path, buf.ptr) < 0)
goto err;
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return git_buf_detach(&path);
err:
- git_buf_free(&buf);
- git_buf_free(&path);
+ git_buf_dispose(&buf);
+ git_buf_dispose(&path);
return NULL;
}
@@ -115,7 +115,7 @@ static int write_wtfile(const char *base, const char *file, const git_buf *buf)
goto out;
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return err;
}
@@ -156,7 +156,7 @@ static int open_worktree_dir(git_worktree **out, const char *parent, const char
out:
if (error)
git_worktree_free(wt);
- git_buf_free(&gitdir);
+ git_buf_dispose(&gitdir);
return error;
}
@@ -178,7 +178,7 @@ int git_worktree_lookup(git_worktree **out, git_repository *repo, const char *na
goto out;
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
if (error)
git_worktree_free(wt);
@@ -213,7 +213,7 @@ int git_worktree_open_from_repository(git_worktree **out, git_repository *repo)
out:
git__free(name);
- git_buf_free(&parent);
+ git_buf_dispose(&parent);
return error;
}
@@ -265,7 +265,7 @@ int git_worktree_validate(const git_worktree *wt)
}
out:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return err;
}
@@ -391,9 +391,9 @@ int git_worktree_add(git_worktree **out, git_repository *repo,
goto out;
out:
- git_buf_free(&gitdir);
- git_buf_free(&wddir);
- git_buf_free(&buf);
+ git_buf_dispose(&gitdir);
+ git_buf_dispose(&wddir);
+ git_buf_dispose(&buf);
git_reference_free(ref);
git_reference_free(head);
git_commit_free(commit);
@@ -424,7 +424,7 @@ int git_worktree_lock(git_worktree *wt, const char *reason)
wt->locked = 1;
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return err;
}
@@ -442,13 +442,13 @@ int git_worktree_unlock(git_worktree *wt)
return -1;
if (p_unlink(path.ptr) != 0) {
- git_buf_free(&path);
+ git_buf_dispose(&path);
return -1;
}
wt->locked = 0;
- git_buf_free(&path);
+ git_buf_dispose(&path);
return 0;
}
@@ -469,7 +469,7 @@ int git_worktree_is_locked(git_buf *reason, const git_worktree *wt)
git_futils_readbuffer(reason, path.ptr);
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return ret;
}
@@ -514,7 +514,7 @@ int git_worktree_is_prunable(git_worktree *wt,
if (!reason.size)
git_buf_attach_notowned(&reason, "no reason given", 15);
giterr_set(GITERR_WORKTREE, "Not pruning locked working tree: '%s'", reason.ptr);
- git_buf_free(&reason);
+ git_buf_dispose(&reason);
return 0;
}
@@ -582,7 +582,7 @@ int git_worktree_prune(git_worktree *wt,
goto out;
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return err;
}