summaryrefslogtreecommitdiff
path: root/src/repository.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/repository.c')
-rw-r--r--src/repository.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/repository.c b/src/repository.c
index deab77192..b49b49b7a 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -361,7 +361,7 @@ static int find_repo(
int git_repository_open_ext(
git_repository **repo_ptr,
const char *start_path,
- uint32_t flags,
+ unsigned int flags,
const char *ceiling_dirs)
{
int error;
@@ -824,7 +824,7 @@ static int repo_init_config(
SET_REPO_CONFIG(string, "core.worktree", work_dir);
}
else if ((opts->flags & GIT_REPOSITORY_INIT__IS_REINIT) != 0) {
- if (git_config_delete(config, "core.worktree") < 0)
+ if (git_config_delete_entry(config, "core.worktree") < 0)
giterr_clear();
}
} else {
@@ -1162,14 +1162,14 @@ int git_repository_init(
}
int git_repository_init_ext(
- git_repository **repo_out,
+ git_repository **out,
const char *given_repo,
git_repository_init_options *opts)
{
int error;
git_buf repo_path = GIT_BUF_INIT, wd_path = GIT_BUF_INIT;
- assert(repo_out && given_repo && opts);
+ assert(out && given_repo && opts);
error = repo_init_directories(&repo_path, &wd_path, given_repo, opts);
if (error < 0)
@@ -1202,10 +1202,10 @@ int git_repository_init_ext(
if (error < 0)
goto cleanup;
- error = git_repository_open(repo_out, git_buf_cstr(&repo_path));
+ error = git_repository_open(out, git_buf_cstr(&repo_path));
if (!error && opts->origin_url)
- error = repo_init_create_origin(*repo_out, opts->origin_url);
+ error = repo_init_create_origin(*out, opts->origin_url);
cleanup:
git_buf_free(&repo_path);
@@ -1231,7 +1231,7 @@ int git_repository_head_detached(git_repository *repo)
return 0;
}
- exists = git_odb_exists(odb, git_reference_oid(ref));
+ exists = git_odb_exists(odb, git_reference_target(ref));
git_reference_free(ref);
return exists;
@@ -1250,7 +1250,7 @@ int git_repository_head(git_reference **head_out, git_repository *repo)
return 0;
}
- error = git_reference_lookup_resolved(head_out, repo, git_reference_target(head), -1);
+ error = git_reference_lookup_resolved(head_out, repo, git_reference_symbolic_target(head), -1);
git_reference_free(head);
return error == GIT_ENOTFOUND ? GIT_EORPHANEDHEAD : error;
@@ -1305,7 +1305,7 @@ int git_repository_is_empty(git_repository *repo)
goto cleanup;
if (!(error = strcmp(
- git_reference_target(head),
+ git_reference_symbolic_target(head),
GIT_REFS_HEADS_DIR "master") == 0))
goto cleanup;
@@ -1356,7 +1356,7 @@ int git_repository_set_workdir(
/* passthrough error means gitlink is unnecessary */
if (error == GIT_PASSTHROUGH)
- error = git_config_delete(config, "core.worktree");
+ error = git_config_delete_entry(config, "core.worktree");
else if (!error)
error = git_config_set_string(config, "core.worktree", path.ptr);
@@ -1531,11 +1531,11 @@ int git_repository_set_head(
if (!error) {
if (git_reference_is_branch(ref))
- error = git_reference_create_symbolic(&new_head, repo, GIT_HEAD_FILE, git_reference_name(ref), 1);
+ error = git_reference_symbolic_create(&new_head, repo, GIT_HEAD_FILE, git_reference_name(ref), 1);
else
- error = git_repository_set_head_detached(repo, git_reference_oid(ref));
+ error = git_repository_set_head_detached(repo, git_reference_target(ref));
} else if (looks_like_a_branch(refname))
- error = git_reference_create_symbolic(&new_head, repo, GIT_HEAD_FILE, refname, 1);
+ error = git_reference_symbolic_create(&new_head, repo, GIT_HEAD_FILE, refname, 1);
git_reference_free(ref);
git_reference_free(new_head);
@@ -1559,7 +1559,7 @@ int git_repository_set_head_detached(
if ((error = git_object_peel(&peeled, object, GIT_OBJ_COMMIT)) < 0)
goto cleanup;
- error = git_reference_create_oid(&new_head, repo, GIT_HEAD_FILE, git_object_id(peeled), 1);
+ error = git_reference_create(&new_head, repo, GIT_HEAD_FILE, git_object_id(peeled), 1);
cleanup:
git_object_free(object);
@@ -1581,10 +1581,10 @@ int git_repository_detach_head(
if ((error = git_repository_head(&old_head, repo)) < 0)
return error;
- if ((error = git_object_lookup(&object, repo, git_reference_oid(old_head), GIT_OBJ_COMMIT)) < 0)
+ if ((error = git_object_lookup(&object, repo, git_reference_target(old_head), GIT_OBJ_COMMIT)) < 0)
goto cleanup;
- error = git_reference_create_oid(&new_head, repo, GIT_HEAD_FILE, git_reference_oid(old_head), 1);
+ error = git_reference_create(&new_head, repo, GIT_HEAD_FILE, git_reference_target(old_head), 1);
cleanup:
git_object_free(object);