Mark message for translation telling the user she has conflicts to
resolve. Expose each particular use case, in order to enable translating
entire sentences which would facilitate translating into other
languages.

Change "Pull" to lowercase to match other messages.

Signed-off-by: Vasco Almeida <vascomalme...@sapo.pt>
---
 advice.c        | 17 +++++++++++++++--
 builtin/pull.c  |  2 +-
 t/t5520-pull.sh |  2 +-
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/advice.c b/advice.c
index 703a847..bc531fc 100644
--- a/advice.c
+++ b/advice.c
@@ -79,7 +79,20 @@ int git_default_advice_config(const char *var, const char 
*value)
 
 int error_resolve_conflict(const char *me)
 {
-       error("%s is not possible because you have unmerged files.", me);
+       if (!strcmp(me, "cherry-pick"))
+               error(_("cherry-pick is not possible because you have unmerged 
files."));
+       else if (!strcmp(me, "commit"))
+               error(_("commit is not possible because you have unmerged 
files."));
+       else if (!strcmp(me, "merge"))
+               error(_("merge is not possible because you have unmerged 
files."));
+       else if (!strcmp(me, "pull"))
+               error(_("pull is not possible because you have unmerged 
files."));
+       else if (!strcmp(me, "revert"))
+               error(_("revert is not possible because you have unmerged 
files."));
+       else
+               error(_("%s is not possible because you have unmerged files."),
+                       me);
+
        if (advice_resolve_conflict)
                /*
                 * Message used both when 'git commit' fails and when
@@ -93,7 +106,7 @@ int error_resolve_conflict(const char *me)
 void NORETURN die_resolve_conflict(const char *me)
 {
        error_resolve_conflict(me);
-       die("Exiting because of an unresolved conflict.");
+       die(_("Exiting because of an unresolved conflict."));
 }
 
 void NORETURN die_conclude_merge(void)
diff --git a/builtin/pull.c b/builtin/pull.c
index 1d7333c..a980dcf 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -852,7 +852,7 @@ int cmd_pull(int argc, const char **argv, const char 
*prefix)
        git_config(git_pull_config, NULL);
 
        if (read_cache_unmerged())
-               die_resolve_conflict("Pull");
+               die_resolve_conflict("pull");
 
        if (file_exists(git_path("MERGE_HEAD")))
                die_conclude_merge();
diff --git a/t/t5520-pull.sh b/t/t5520-pull.sh
index 739c089..61beff6 100755
--- a/t/t5520-pull.sh
+++ b/t/t5520-pull.sh
@@ -211,7 +211,7 @@ test_expect_success 'fail if the index has unresolved 
entries' '
        test -n "$(git ls-files -u)" &&
        cp file expected &&
        test_must_fail git pull . second 2>err &&
-       test_i18ngrep "Pull is not possible because you have unmerged files" 
err &&
+       test_i18ngrep "pull is not possible because you have unmerged files" 
err &&
        test_cmp expected file &&
        git add file &&
        test -z "$(git ls-files -u)" &&
-- 
2.7.3

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to