Commit 412a3808 by Carlos Martín Nieto

push: remove reflog message override

We always use "update by push".
parent 6bfb990d
......@@ -376,9 +376,10 @@ GIT_EXTERN(void) git_remote_free(git_remote *remote);
* Update the tips to the new state
*
* @param remote the remote to update
* @param reflog_message The message to insert into the reflogs. If NULL, the
* default is "fetch <name>", where <name> is the name of
* the remote (or its url, for in-memory remotes).
* @param reflog_message The message to insert into the reflogs. If
* NULL and fetching, the default is "fetch <name>", where <name> is
* the name of the remote (or its url, for in-memory remotes). This
* parameter is ignored when pushing.
* @return 0 or an error code
*/
GIT_EXTERN(int) git_remote_update_tips(
......@@ -420,12 +421,10 @@ GIT_EXTERN(int) git_remote_fetch(
* @param refspecs the refspecs to use for pushing. If none are
* passed, the configured refspecs will be used
* @param opts the options
* @param reflog_message message to use for the reflog of upated references
*/
GIT_EXTERN(int) git_remote_push(git_remote *remote,
const git_strarray *refspecs,
const git_push_options *opts,
const char *reflog_message);
const git_push_options *opts);
/**
* Get a list of the configured remotes for a repo
......
......@@ -167,9 +167,7 @@ int git_push_add_refspec(git_push *push, const char *refspec)
return 0;
}
int git_push_update_tips(
git_push *push,
const char *reflog_message)
int git_push_update_tips(git_push *push)
{
git_buf remote_ref_name = GIT_BUF_INIT;
size_t i, j;
......@@ -213,7 +211,7 @@ int git_push_update_tips(
} else {
error = git_reference_create(NULL, push->remote->repo,
git_buf_cstr(&remote_ref_name), &push_spec->loid, 1,
reflog_message ? reflog_message : "update by push");
"update by push");
}
}
......
......@@ -109,14 +109,10 @@ int git_push_add_refspec(git_push *push, const char *refspec);
*
* @param push The push object
* @param signature The identity to use when updating reflogs
* @param reflog_message The message to insert into the reflogs. If NULL, the
* default is "update by push".
*
* @return 0 or an error code
*/
int git_push_update_tips(
git_push *push,
const char *reflog_message);
int git_push_update_tips(git_push *push);
/**
* Perform the push
......
......@@ -1461,7 +1461,7 @@ int git_remote_update_tips(
/* push has its own logic hidden away in the push object */
if (remote->push) {
return git_push_update_tips(remote->push, reflog_message);
return git_push_update_tips(remote->push);
}
if (git_refspec__parse(&tagspec, GIT_REFSPEC_TAGS, true) < 0)
......@@ -2370,8 +2370,7 @@ cleanup:
return error;
}
int git_remote_push(git_remote *remote, const git_strarray *refspecs, const git_push_options *opts,
const char *reflog_message)
int git_remote_push(git_remote *remote, const git_strarray *refspecs, const git_push_options *opts)
{
int error;
......@@ -2383,7 +2382,7 @@ int git_remote_push(git_remote *remote, const git_strarray *refspecs, const git_
if ((error = git_remote_upload(remote, refspecs, opts)) < 0)
return error;
error = git_remote_update_tips(remote, reflog_message);
error = git_remote_update_tips(remote, NULL);
git_remote_disconnect(remote);
return error;
......
......@@ -464,12 +464,12 @@ void test_network_remote_local__push_delete(void)
cl_git_pass(git_remote_create(&remote, src_repo, "origin", "./target.git"));
/* Push the master branch and verify it's there */
cl_git_pass(git_remote_push(remote, &specs, NULL, NULL));
cl_git_pass(git_remote_push(remote, &specs, NULL));
cl_git_pass(git_reference_lookup(&ref, dst_repo, "refs/heads/master"));
git_reference_free(ref);
specs.strings = spec_delete;
cl_git_pass(git_remote_push(remote, &specs, NULL, NULL));
cl_git_pass(git_remote_push(remote, &specs, NULL));
cl_git_fail(git_reference_lookup(&ref, dst_repo, "refs/heads/master"));
git_remote_free(remote);
......
......@@ -487,7 +487,7 @@ static void do_push(
if (check_progress_cb && expected_ret == GIT_EUSER)
data->transfer_progress_calls = GIT_EUSER;
error = git_remote_push(_remote, &specs, &opts, "test push");
error = git_remote_push(_remote, &specs, &opts);
git__free(specs.strings);
if (expected_ret < 0) {
......@@ -608,7 +608,7 @@ void test_online_push__multi(void)
cl_git_pass(git_reflog_read(&log, _repo, "refs/remotes/test/b1"));
entry = git_reflog_entry_byindex(log, 0);
if (entry) {
cl_assert_equal_s("test push", git_reflog_entry_message(entry));
cl_assert_equal_s("update by push", git_reflog_entry_message(entry));
cl_assert_equal_s("foo@example.com", git_reflog_entry_committer(entry)->email);
}
......
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