]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/common-main-2.8' into jk/common-main
authorJunio C Hamano <gitster@pobox.com>
Wed, 6 Jul 2016 17:02:57 +0000 (10:02 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 6 Jul 2016 17:02:57 +0000 (10:02 -0700)
* jk/common-main-2.8:
  mingw: declare main()'s argv as const
  common-main: call git_setup_gettext()
  common-main: call restore_sigpipe_to_default()
  common-main: call sanitize_stdfds()
  common-main: call git_extract_argv0_path()
  add an extra level of indirection to main()

41 files changed:
1  2 
Makefile
credential-cache--daemon.c
fast-import.c
git-compat-util.h
http-backend.c
http-push.c
remote-curl.c
t/helper/test-chmtime.c
t/helper/test-config.c
t/helper/test-ctype.c
t/helper/test-date.c
t/helper/test-delta.c
t/helper/test-dump-cache-tree.c
t/helper/test-dump-split-index.c
t/helper/test-dump-untracked-cache.c
t/helper/test-fake-ssh.c
t/helper/test-genrandom.c
t/helper/test-hashmap.c
t/helper/test-index-version.c
t/helper/test-line-buffer.c
t/helper/test-match-trees.c
t/helper/test-mergesort.c
t/helper/test-mktemp.c
t/helper/test-parse-options.c
t/helper/test-path-utils.c
t/helper/test-prio-queue.c
t/helper/test-read-cache.c
t/helper/test-regex.c
t/helper/test-revision-walking.c
t/helper/test-run-command.c
t/helper/test-scrap-cache-tree.c
t/helper/test-sha1-array.c
t/helper/test-sha1.c
t/helper/test-sigchain.c
t/helper/test-string-list.c
t/helper/test-submodule-config.c
t/helper/test-subprocess.c
t/helper/test-svn-fe.c
t/helper/test-urlmatch-normalization.c
t/helper/test-wildmatch.c
upload-pack.c

diff --cc Makefile
Simple merge
Simple merge
diff --cc fast-import.c
Simple merge
Simple merge
diff --cc http-backend.c
Simple merge
diff --cc http-push.c
Simple merge
diff --cc remote-curl.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index d446b8eaca727dfa9c1b0928f2b8c9af286f2702,afcdc143b51e0143f8d8761b927ff02b42ca7580..e9395028630bf26390366065aa07bc7b2827eb73
@@@ -1,9 -1,9 +1,9 @@@
  #include "cache.h"
  #include "tree.h"
  
- int main(int ac, char **av)
+ int cmd_main(int ac, const char **av)
  {
 -      unsigned char hash1[20], hash2[20], shifted[20];
 +      struct object_id hash1, hash2, shifted;
        struct tree *one, *two;
  
        setup_git_directory();
Simple merge
Simple merge
index 8a1235d03e2daab4b9e90d31c5da6708e5c712f2,7adae43b87a8e89652681b850e6e6d586ef30462..d51d29251eb2cf5adeba1d4f94ff2ce100421560
@@@ -39,62 -30,7 +39,62 @@@ static int number_callback(const struc
        return 0;
  }
  
- int main(int argc, char **argv)
 +static int collect_expect(const struct option *opt, const char *arg, int unset)
 +{
 +      struct string_list *expect;
 +      struct string_list_item *item;
 +      struct strbuf label = STRBUF_INIT;
 +      const char *colon;
 +
 +      if (!arg || unset)
 +              die("malformed --expect option");
 +
 +      expect = (struct string_list *)opt->value;
 +      colon = strchr(arg, ':');
 +      if (!colon)
 +              die("malformed --expect option, lacking a colon");
 +      strbuf_add(&label, arg, colon - arg);
 +      item = string_list_insert(expect, strbuf_detach(&label, NULL));
 +      if (item->util)
 +              die("malformed --expect option, duplicate %s", label.buf);
 +      item->util = (void *)arg;
 +      return 0;
 +}
 +
 +__attribute__((format (printf,3,4)))
 +static void show(struct string_list *expect, int *status, const char *fmt, ...)
 +{
 +      struct string_list_item *item;
 +      struct strbuf buf = STRBUF_INIT;
 +      va_list args;
 +
 +      va_start(args, fmt);
 +      strbuf_vaddf(&buf, fmt, args);
 +      va_end(args);
 +
 +      if (!expect->nr)
 +              printf("%s\n", buf.buf);
 +      else {
 +              char *colon = strchr(buf.buf, ':');
 +              if (!colon)
 +                      die("malformed output format, output lacking colon: %s", fmt);
 +              *colon = '\0';
 +              item = string_list_lookup(expect, buf.buf);
 +              *colon = ':';
 +              if (!item)
 +                      ; /* not among entries being checked */
 +              else {
 +                      if (strcmp((const char *)item->util, buf.buf)) {
 +                              printf("-%s\n", (char *)item->util);
 +                              printf("+%s\n", buf.buf);
 +                              *status = 1;
 +                      }
 +              }
 +      }
 +      strbuf_release(&buf);
 +}
 +
+ int cmd_main(int argc, const char **argv)
  {
        const char *prefix = "prefix/";
        const char *usage[] = {
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc upload-pack.c
Simple merge