From: Junio C Hamano Date: Wed, 10 Sep 2008 05:57:35 +0000 (-0700) Subject: Merge branch 'ho/dashless' X-Git-Tag: v1.6.1-rc1~254 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/a15a435ad394548fb6d22fa69f9a0e6db9752298?ds=inline;hp=-c Merge branch 'ho/dashless' * ho/dashless: Start conforming code to "git subcmd" style part 2 --- a15a435ad394548fb6d22fa69f9a0e6db9752298 diff --combined builtin-commit-tree.c index 8a5ba4c667,9b84c48dce..f2684bb75e --- a/builtin-commit-tree.c +++ b/builtin-commit-tree.c @@@ -24,7 -24,7 +24,7 @@@ static void check_valid(unsigned char * typename(expect)); } - static const char commit_tree_usage[] = "git-commit-tree [-p ]* < changelog"; + static const char commit_tree_usage[] = "git commit-tree [-p ]* < changelog"; static void new_parent(struct commit *parent, struct commit_list **parents_p) { @@@ -48,7 -48,6 +48,7 @@@ static const char commit_utf8_warn[] int commit_tree(const char *msg, unsigned char *tree, struct commit_list *parents, unsigned char *ret) { + int result; int encoding_is_utf8; struct strbuf buffer; @@@ -87,9 -86,7 +87,9 @@@ if (encoding_is_utf8 && !is_utf8(buffer.buf)) fprintf(stderr, commit_utf8_warn); - return write_sha1_file(buffer.buf, buffer.len, commit_type, ret); + result = write_sha1_file(buffer.buf, buffer.len, commit_type, ret); + strbuf_release(&buffer); + return result; } int cmd_commit_tree(int argc, const char **argv, const char *prefix) diff --combined builtin-fetch-pack.c index 459c6f0da3,85509f5ee5..4dfef29bcd --- a/builtin-fetch-pack.c +++ b/builtin-fetch-pack.c @@@ -540,7 -540,7 +540,7 @@@ static int get_pack(int xd[2], char **p *av++ = "--fix-thin"; if (args.lock_pack || unpack_limit) { int s = sprintf(keep_arg, - "--keep=fetch-pack %d on ", getpid()); + "--keep=fetch-pack %"PRIuMAX " on ", (uintmax_t) getpid()); if (gethostname(keep_arg + s, sizeof(keep_arg) - s)) strcpy(keep_arg + s, "localhost"); *av++ = keep_arg; @@@ -750,7 -750,7 +750,7 @@@ int cmd_fetch_pack(int argc, const cha if (!ret && nr_heads) { /* If the heads to pull were given, we should have * consumed all of them by matching the remote. - * Otherwise, 'git-fetch remote no-such-ref' would + * Otherwise, 'git fetch remote no-such-ref' would * silently succeed without issuing an error. */ for (i = 0; i < nr_heads; i++) diff --combined builtin-http-fetch.c index ea2b689651,03f34d767d..f3e63d7206 --- a/builtin-http-fetch.c +++ b/builtin-http-fetch.c @@@ -42,7 -42,7 +42,7 @@@ int cmd_http_fetch(int argc, const cha arg++; } if (argc < arg + 2 - commits_on_stdin) { - usage("git-http-fetch [-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin] commit-id url"); + usage("git http-fetch [-c] [-t] [-a] [-v] [--recover] [-w ref] [--stdin] commit-id url"); return 1; } if (commits_on_stdin) { @@@ -53,7 -53,7 +53,7 @@@ } url = argv[arg]; if (url && url[strlen(url)-1] != '/') { - rewritten_url = malloc(strlen(url)+2); + rewritten_url = xmalloc(strlen(url)+2); strcpy(rewritten_url, url); strcat(rewritten_url, "/"); url = rewritten_url; @@@ -75,7 -75,7 +75,7 @@@ fprintf(stderr, "Some loose object were found to be corrupt, but they might be just\n" "a false '404 Not Found' error message sent with incorrect HTTP\n" - "status code. Suggest running git-fsck.\n"); + "status code. Suggest running 'git fsck'.\n"); } walker_free(walker);