summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-06-27 14:29:59 -0700
committerJunio C Hamano <gitster@pobox.com>2013-06-27 14:30:00 -0700
commit644daa9428323ecdef08dfce589aa386bd2d97d4 (patch)
tree753768aacbca6ee1b307168bc50f26eb7c319664 /sequencer.c
parentb29dc5c671150ff0c4afa41cdd8fec9c86ffe6eb (diff)
parenteb4be1cbe2e50c9bfaa09839564723de257869fc (diff)
downloadgit-644daa9428323ecdef08dfce589aa386bd2d97d4.tar.gz
Merge branch 'rr/cherry-pick-fast-forward-reflog-message'
The reflog message created when "git cherry-pick" fast-forwarded did not say anything but "cherry-pick", but it now says "cherry-pick: fast-forward". * rr/cherry-pick-fast-forward-reflog-message: sequencer: write useful reflog message for fast-forward
Diffstat (limited to 'sequencer.c')
-rw-r--r--sequencer.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sequencer.c b/sequencer.c
index f7be7d8be6..425207ad5f 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -270,15 +270,20 @@ static int error_dirty_index(struct replay_opts *opts)
}
static int fast_forward_to(const unsigned char *to, const unsigned char *from,
- int unborn)
+ int unborn, struct replay_opts *opts)
{
struct ref_lock *ref_lock;
+ struct strbuf sb = STRBUF_INIT;
+ int ret;
read_cache();
if (checkout_fast_forward(from, to, 1))
exit(1); /* the callee should have complained already */
ref_lock = lock_any_ref_for_update("HEAD", unborn ? null_sha1 : from, 0);
- return write_ref_sha1(ref_lock, to, "cherry-pick");
+ strbuf_addf(&sb, "%s: fast-forward", action_name(opts));
+ ret = write_ref_sha1(ref_lock, to, sb.buf);
+ strbuf_release(&sb);
+ return ret;
}
static int do_recursive_merge(struct commit *base, struct commit *next,
@@ -523,7 +528,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
if (opts->allow_ff &&
((parent && !hashcmp(parent->object.sha1, head)) ||
(!parent && unborn)))
- return fast_forward_to(commit->object.sha1, head, unborn);
+ return fast_forward_to(commit->object.sha1, head, unborn, opts);
if (parent && parse_commit(parent) < 0)
/* TRANSLATORS: The first %s will be "revert" or