summaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2013-04-02 16:20:22 +0200
committerJunio C Hamano <gitster@pobox.com>2013-04-02 14:22:56 -0700
commit87e139c0ad32b72ad989fe7d69381f1146250f7a (patch)
treef83a437db7c9a0eb73a50326e184cecd7a5fd344 /wt-status.c
parentdb4ef4496e7a99809f7caa52e8821320e5cca7bc (diff)
downloadgit-87e139c0ad32b72ad989fe7d69381f1146250f7a.tar.gz
status: show commit sha1 in "You are currently reverting" message
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'wt-status.c')
-rw-r--r--wt-status.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/wt-status.c b/wt-status.c
index 39f888bcc8..09416db348 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -969,7 +969,8 @@ static void show_revert_in_progress(struct wt_status *s,
struct wt_status_state *state,
const char *color)
{
- status_printf_ln(s, color, _("You are currently reverting a commit."));
+ status_printf_ln(s, color, _("You are currently reverting commit %s."),
+ find_unique_abbrev(state->revert_head_sha1, DEFAULT_ABBREV));
if (advice_status_hints) {
if (has_unmerged(s))
status_printf_ln(s, color,
@@ -1104,6 +1105,7 @@ void wt_status_get_state(struct wt_status_state *state,
int get_detached_from)
{
struct stat st;
+ unsigned char sha1[20];
if (!stat(git_path("MERGE_HEAD"), &st)) {
state->merge_in_progress = 1;
@@ -1131,8 +1133,10 @@ void wt_status_get_state(struct wt_status_state *state,
state->bisect_in_progress = 1;
state->branch = read_and_strip_branch("BISECT_START");
}
- if (!stat(git_path("REVERT_HEAD"), &st)) {
+ if (!stat(git_path("REVERT_HEAD"), &st) &&
+ !get_sha1("REVERT_HEAD", sha1)) {
state->revert_in_progress = 1;
+ hashcpy(state->revert_head_sha1, sha1);
}
if (get_detached_from)