diff options
| author | Edward Thomson <ethomson@microsoft.com> | 2013-12-09 10:25:36 -0500 |
|---|---|---|
| committer | Edward Thomson <ethomson@microsoft.com> | 2013-12-09 11:40:44 -0500 |
| commit | 5588f0736089ab00e12cb7ea7c8143ec666738e6 (patch) | |
| tree | 1f877c23d223d4dedabafb4bc6c793efe82f9fdc /src/revert.c | |
| parent | 07c5dc84fd486b380d618319b4852591d355bd81 (diff) | |
| download | libgit2-5588f0736089ab00e12cb7ea7c8143ec666738e6.tar.gz | |
Clean up warnings
Diffstat (limited to 'src/revert.c')
| -rw-r--r-- | src/revert.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/revert.c b/src/revert.c index 7ed04fee3..6cfd591b4 100644 --- a/src/revert.c +++ b/src/revert.c @@ -20,15 +20,12 @@ static int write_revert_head( git_repository *repo, - const git_commit *commit, const char *commit_oidstr) { git_filebuf file = GIT_FILEBUF_INIT; git_buf file_path = GIT_BUF_INIT; int error = 0; - assert(repo && commit); - if ((error = git_buf_joinpath(&file_path, repo->path_repository, GIT_REVERT_HEAD_FILE)) >= 0 && (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_FORCE, GIT_REVERT_FILE_MODE)) >= 0 && (error = git_filebuf_printf(&file, "%s\n", commit_oidstr)) >= 0) @@ -44,7 +41,6 @@ static int write_revert_head( static int write_merge_msg( git_repository *repo, - const git_commit *commit, const char *commit_oidstr, const char *commit_msgline) { @@ -52,8 +48,6 @@ static int write_merge_msg( git_buf file_path = GIT_BUF_INIT; int error = 0; - assert(repo && commit); - if ((error = git_buf_joinpath(&file_path, repo->path_repository, GIT_MERGE_MSG_FILE)) < 0 || (error = git_filebuf_open(&file, file_path.ptr, GIT_FILEBUF_FORCE, GIT_REVERT_FILE_MODE)) < 0 || (error = git_filebuf_printf(&file, "Revert \"%s\"\n\nThis reverts commit %s.\n", @@ -198,8 +192,8 @@ int git_revert( if ((error = git_buf_printf(&their_label, "parent of %.7s... %s", commit_oidstr, commit_msg)) < 0 || (error = revert_normalize_opts(repo, &opts, given_opts, git_buf_cstr(&their_label))) < 0 || - (error = write_revert_head(repo, commit, commit_oidstr)) < 0 || - (error = write_merge_msg(repo, commit, commit_oidstr, commit_msg)) < 0 || + (error = write_revert_head(repo, commit_oidstr)) < 0 || + (error = write_merge_msg(repo, commit_oidstr, commit_msg)) < 0 || (error = git_repository_head(&our_ref, repo)) < 0 || (error = git_reference_peel((git_object **)&our_commit, our_ref, GIT_OBJ_COMMIT)) < 0 || (error = git_revert_commit(&index_new, repo, commit, our_commit, opts.mainline, &opts.merge_tree_opts)) < 0 || |
