i18n: git-commit print_summary messages
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 <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Ævar Arnfjörð Bjarmason committed
Feb 22, 2011 at 23:41 UTC
7f5673d7030a4792319917ece0484d8379aa811f
2 files changed
+10
-4
builtin/commit.c
+2
-2
@@ -1223,9 +1223,9 @@ static void print_summary(const char *prefix, const unsigned char *sha1)
1223
!prefixcmp(head, "refs/heads/") ?
1224
head + 11 :
1225
!strcmp(head, "HEAD") ?
1226
- "detached HEAD" :
1226
+ _("detached HEAD") :
1227
head,
1228
- initial_commit ? " (root-commit)" : "");
1228
+ initial_commit ? _(" (root-commit)") : "");
1229
1230
if (!log_tree_commit(&rev, commit)) {
1231
rev.always_show_header = 1;
t/t7502-commit.sh
+8
-2
@@ -22,7 +22,10 @@ check_summary_oneline() {
22
SUMMARY_POSTFIX="$(git log -1 --pretty='format:%h')"
23
echo "[$SUMMARY_PREFIX $SUMMARY_POSTFIX] $2" >exp &&
24
25
- test_cmp exp act
25
+ if test_have_prereq C_LOCALE_OUTPUT
26
+ then
27
+ test_cmp exp act
28
+ fi
29
}
30
31
test_expect_success 'output summary format' '
@@ -32,7 +35,10 @@ test_expect_success 'output summary format' '
35
check_summary_oneline "root-commit" "initial" &&
36
37
echo change >>file1 &&
35
- git add file1 &&
38
+ git add file1
39
+'
40
+
41
+test_expect_success 'output summary format: root-commit' '
42
check_summary_oneline "" "a change"
43
'
44