Commit 3dbd9a0e by Jacques Germishuys

Check the result of git_buf_joinpath

parent 6f73e026
...@@ -592,7 +592,8 @@ static int rebase_init( ...@@ -592,7 +592,8 @@ static int rebase_init(
git_buf state_path = GIT_BUF_INIT; git_buf state_path = GIT_BUF_INIT;
int error; int error;
git_buf_joinpath(&state_path, repo->path_repository, REBASE_MERGE_DIR); if ((error = git_buf_joinpath(&state_path, repo->path_repository, REBASE_MERGE_DIR)) < 0)
return error;
rebase->repo = repo; rebase->repo = repo;
rebase->type = GIT_REBASE_TYPE_MERGE; rebase->type = GIT_REBASE_TYPE_MERGE;
......
...@@ -656,7 +656,8 @@ int git_repository_odb__weakptr(git_odb **out, git_repository *repo) ...@@ -656,7 +656,8 @@ int git_repository_odb__weakptr(git_odb **out, git_repository *repo)
git_buf odb_path = GIT_BUF_INIT; git_buf odb_path = GIT_BUF_INIT;
git_odb *odb; git_odb *odb;
git_buf_joinpath(&odb_path, repo->path_repository, GIT_OBJECTS_DIR); if ((error = git_buf_joinpath(&odb_path, repo->path_repository, GIT_OBJECTS_DIR)) < 0)
return error;
error = git_odb_open(&odb, odb_path.ptr); error = git_odb_open(&odb, odb_path.ptr);
if (!error) { if (!error) {
...@@ -741,7 +742,8 @@ int git_repository_index__weakptr(git_index **out, git_repository *repo) ...@@ -741,7 +742,8 @@ int git_repository_index__weakptr(git_index **out, git_repository *repo)
git_buf index_path = GIT_BUF_INIT; git_buf index_path = GIT_BUF_INIT;
git_index *index; git_index *index;
git_buf_joinpath(&index_path, repo->path_repository, GIT_INDEX_FILE); if ((error = git_buf_joinpath(&index_path, repo->path_repository, GIT_INDEX_FILE)) < 0)
return error;
error = git_index_open(&index, index_path.ptr); error = git_index_open(&index, index_path.ptr);
if (!error) { if (!error) {
...@@ -2068,7 +2070,9 @@ int git_repository_is_shallow(git_repository *repo) ...@@ -2068,7 +2070,9 @@ int git_repository_is_shallow(git_repository *repo)
struct stat st; struct stat st;
int error; int error;
git_buf_joinpath(&path, repo->path_repository, "shallow"); if ((error = git_buf_joinpath(&path, repo->path_repository, "shallow")) < 0)
return error;
error = git_path_lstat(path.ptr, &st); error = git_path_lstat(path.ptr, &st);
git_buf_free(&path); git_buf_free(&path);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment