From 7f5673d7030a4792319917ece0484d8379aa811f Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Tue, 22 Feb 2011 23:41:47 +0000 Subject: [PATCH] i18n: git-commit print_summary messages MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Gettextize the "(root-commit)" and "detached HEAD" fragments that appear when you commit either the root commit, or a commit in a detached head translatable. Signed-off-by: Ævar Arnfjörð Bjarmason Signed-off-by: Junio C Hamano --- builtin/commit.c | 4 ++-- t/t7502-commit.sh | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/builtin/commit.c b/builtin/commit.c index c1da66c2d7..4986cd442c 100644 --- a/builtin/commit.c +++ b/builtin/commit.c @@ -1223,9 +1223,9 @@ static void print_summary(const char *prefix, const unsigned char *sha1) !prefixcmp(head, "refs/heads/") ? head + 11 : !strcmp(head, "HEAD") ? - "detached HEAD" : + _("detached HEAD") : head, - initial_commit ? " (root-commit)" : ""); + initial_commit ? _(" (root-commit)") : ""); if (!log_tree_commit(&rev, commit)) { rev.always_show_header = 1; diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh index 034b9c35aa..dad1b2b80d 100755 --- a/t/t7502-commit.sh +++ b/t/t7502-commit.sh @@ -22,7 +22,10 @@ check_summary_oneline() { SUMMARY_POSTFIX="$(git log -1 --pretty='format:%h')" echo "[$SUMMARY_PREFIX $SUMMARY_POSTFIX] $2" >exp && - test_cmp exp act + if test_have_prereq C_LOCALE_OUTPUT + then + test_cmp exp act + fi } test_expect_success 'output summary format' ' @@ -32,7 +35,10 @@ test_expect_success 'output summary format' ' check_summary_oneline "root-commit" "initial" && echo change >>file1 && - git add file1 && + git add file1 +' + +test_expect_success 'output summary format: root-commit' ' check_summary_oneline "" "a change" ' -- 2.32.0.93.g670b81a890