Merge branch 'ho/dashless'
authorJunio C Hamano <gitster@pobox.com>
Wed, 10 Sep 2008 05:57:35 +0000 (22:57 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 10 Sep 2008 05:57:35 +0000 (22:57 -0700)
* ho/dashless:
Start conforming code to "git subcmd" style part 2

1  2 
builtin-commit-tree.c
builtin-fetch-pack.c
builtin-http-fetch.c
diff --combined builtin-commit-tree.c
index 8a5ba4c6671e426338eb0cb95bd92851bf24b452,9b84c48dce0938f4f2884565dc25308d51c7a423..f2684bb75e2319f2797bfe626e15bc27bd76f21a
@@@ -24,7 -24,7 +24,7 @@@ static void check_valid(unsigned char *
                    typename(expect));
  }
  
- static const char commit_tree_usage[] = "git-commit-tree <sha1> [-p <sha1>]* < changelog";
+ static const char commit_tree_usage[] = "git commit-tree <sha1> [-p <sha1>]* < 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 459c6f0da35ac0a4d6cc0a914f6aa905f8a94d42,85509f5ee5884589980c9a1c5f96b66a3d49d5dd..4dfef29bcd23a174593203e521247a3d4209cf89
@@@ -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 ea2b6896519aeb5912f70b62a451a1d1456695e8,03f34d767ddfc3c7bc9b18d28ec7350d47564679..f3e63d7206604029504aaf85b3d2e7731d054d2c
@@@ -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);