From: Junio C Hamano Date: Wed, 2 May 2012 20:53:35 +0000 (-0700) Subject: Merge branch 'pw/message-cleanup' X-Git-Tag: v1.7.11-rc0~66 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/2fa4fff4b9ba9998685c0b38cbadb49ac38734ce?ds=inline;hp=-c Merge branch 'pw/message-cleanup' Many error/warning messages had extra trailing newlines that are unnecessary. By Pete Wyckoff * pw/message-cleanup: remove blank filename in error message remove superfluous newlines in error messages --- 2fa4fff4b9ba9998685c0b38cbadb49ac38734ce diff --combined builtin/branch.c index 8813d2e31c,dc353ffe65..f12b626a0e --- a/builtin/branch.c +++ b/builtin/branch.c @@@ -152,22 -152,21 +152,22 @@@ static int delete_branches(int argc, co struct commit *rev, *head_rev = NULL; unsigned char sha1[20]; char *name = NULL; - const char *fmt, *remote; + const char *fmt; int i; int ret = 0; + int remote_branch = 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 "); + /* For subsequent UI messages */ + remote_branch = 1; + force = 1; break; case REF_LOCAL_BRANCH: fmt = "refs/heads/%s"; - remote = ""; break; default: die(_("cannot use -a with -d")); @@@ -191,9 -190,8 +191,9 @@@ name = xstrdup(mkpath(fmt, bname.buf)); if (read_ref(name, sha1)) { - error(_("%sbranch '%s' not found."), - remote, bname.buf); + error(remote_branch + ? _("remote branch '%s' not found.") + : _("branch '%s' not found."), bname.buf); ret = 1; continue; } @@@ -214,18 -212,14 +214,18 @@@ } if (delete_ref(name, sha1, 0)) { - error(_("Error deleting %sbranch '%s'"), remote, + error(remote_branch + ? _("Error deleting remote branch '%s'") + : _("Error deleting branch '%s'"), bname.buf); ret = 1; } else { struct strbuf buf = STRBUF_INIT; if (!quiet) - printf(_("Deleted %sbranch %s (was %s).\n"), - remote, bname.buf, + printf(remote_branch + ? _("Deleted remote branch %s (was %s).\n") + : _("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) @@@ -663,7 -657,7 +663,7 @@@ static int edit_branch_description(cons fp = fopen(git_path(edit_description), "w"); if ((fwrite(buf.buf, 1, buf.len, fp) < buf.len) || fclose(fp)) { strbuf_release(&buf); - return error(_("could not write branch description template: %s\n"), + return error(_("could not write branch description template: %s"), strerror(errno)); } strbuf_reset(&buf); diff --combined unpack-trees.c index 1d7393d84c,7cfa026b1a..bcee99c52e --- a/unpack-trees.c +++ b/unpack-trees.c @@@ -1027,7 -1027,6 +1027,7 @@@ int unpack_trees(unsigned len, struct t o->result.initialized = 1; o->result.timestamp.sec = o->src_index->timestamp.sec; o->result.timestamp.nsec = o->src_index->timestamp.nsec; + o->result.version = o->src_index->version; o->merge_size = len; mark_all_ce_unused(o->src_index); @@@ -1793,7 -1792,7 +1793,7 @@@ int bind_merge(struct cache_entry **src struct cache_entry *a = src[1]; if (o->merge_size != 1) - return error("Cannot do a bind merge of %d trees\n", + return error("Cannot do a bind merge of %d trees", o->merge_size); if (a && old) return o->gently ? -1 :