From 7b1475cbffe120fdae1b46a2974a7b94846702c4 Mon Sep 17 00:00:00 2001 From: Frederik Schwarzer Date: Mon, 30 Jan 2012 12:02:46 +0100 Subject: [PATCH] Avoid puzzle sentences. --- builtin/branch.c | 27 ++++++++++++++++++--------- 1 files changed, 18 insertions(+), 9 deletions(-) diff --git a/builtin/branch.c b/builtin/branch.c index 7095718..a07ac54 100644 --- a/builtin/branch.c +++ b/builtin/branch.c @@ -154,18 +154,17 @@ static int delete_branches(int argc, const char **argv, int force, int kinds) const char *fmt, *remote; int i; int ret = 0; + int is_remote = 0; struct strbuf bname = STRBUF_INIT; switch (kinds) { case REF_REMOTE_BRANCH: fmt = "refs/remotes/%s"; - /* TRANSLATORS: This is "remote " in "remote branch '%s' not found" */ - remote = _("remote "); + is_remote = 1; force = 1; break; case REF_LOCAL_BRANCH: fmt = "refs/heads/%s"; - remote = ""; break; default: die(_("cannot use -a with -d")); @@ -189,8 +188,11 @@ static int delete_branches(int argc, const char **argv, int force, int kinds) name = xstrdup(mkpath(fmt, bname.buf)); if (read_ref(name, sha1)) { - error(_("%sbranch '%s' not found."), - remote, bname.buf); + if (is_remote) { + error(_("remote branch '%s' not found."), bname.buf); + } else { + error(_("branch '%s' not found."), bname.buf); + } ret = 1; continue; } @@ -211,14 +213,21 @@ static int delete_branches(int argc, const char **argv, int force, int kinds) } if (delete_ref(name, sha1, 0)) { - error(_("Error deleting %sbranch '%s'"), remote, - bname.buf); + if (is_remote) { + error(_("Error deleting remote branch '%s'"), bname.buf); + } else { + error(_("Error deleting branch '%s'"), bname.buf); + } ret = 1; } else { struct strbuf buf = STRBUF_INIT; - printf(_("Deleted %sbranch %s (was %s).\n"), remote, - bname.buf, + if (is_remote) { + printf(_("Deleted remote branch %s (was %s).\n"), bname.buf, find_unique_abbrev(sha1, DEFAULT_ABBREV)); + } else { + printf(_("Deleted branch %s (was %s).\n"), bname.buf, + find_unique_abbrev(sha1, DEFAULT_ABBREV)); + } strbuf_addf(&buf, "branch.%s", bname.buf); if (git_config_rename_section(buf.buf, NULL) < 0) warning(_("Update of config-file failed")); -- 1.7.8.3