Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Thu, 25 Aug 2011 23:00:07 +0000 (16:00 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 25 Aug 2011 23:00:07 +0000 (16:00 -0700)
* maint:
whitespace: have SP on both sides of an assignment "="
update-ref: whitespace fix

1  2 
builtin/remote.c
read-cache.c
diff --combined builtin/remote.c
index 05b1f5b76de36b19ef4bebba32aff1b40cbc2030,1fb441c964ba4942876865c3d84d9b49d9e5d8f8..f2a9c26dc3494c0881ca3f91b44785c4b52caae7
@@@ -88,6 -88,16 +88,6 @@@ static inline int postfixcmp(const cha
        return strcmp(string + len1 - len2, postfix);
  }
  
 -static int opt_parse_track(const struct option *opt, const char *arg, int not)
 -{
 -      struct string_list *list = opt->value;
 -      if (not)
 -              string_list_clear(list, 0);
 -      else
 -              string_list_append(list, arg);
 -      return 0;
 -}
 -
  static int fetch_remote(const char *name)
  {
        const char *argv[] = { "fetch", name, NULL, NULL };
@@@ -166,8 -176,8 +166,8 @@@ static int add(int argc, const char **a
                            TAGS_SET),
                OPT_SET_INT(0, NULL, &fetch_tags,
                            "or do not fetch any tag at all (--no-tags)", TAGS_UNSET),
 -              OPT_CALLBACK('t', "track", &track, "branch",
 -                      "branch(es) to track", opt_parse_track),
 +              OPT_STRING_LIST('t', "track", &track, "branch",
 +                              "branch(es) to track"),
                OPT_STRING('m', "master", &master, "branch", "master branch"),
                { OPTION_CALLBACK, 0, "mirror", &mirror, "push|fetch",
                        "set up remote as a mirror to push to or fetch from",
@@@ -1103,7 -1113,7 +1103,7 @@@ static int show(int argc, const char **
                        url = states.remote->url;
                        url_nr = states.remote->url_nr;
                }
-               for (i=0; i < url_nr; i++)
+               for (i = 0; i < url_nr; i++)
                        printf("  Push  URL: %s\n", url[i]);
                if (!i)
                        printf("  Push  URL: %s\n", "(no URL)");
diff --combined read-cache.c
index 46a9e60708ad98db5299f9242db05de5915a0ebb,0a641034ce164fff91c9e8736b28cf98b6eba6bb..01a0e2505121f10544ee03948e545d07c24f366e
@@@ -726,12 -726,11 +726,12 @@@ static int verify_dotfile(const char *r
         * has already been discarded, we now test
         * the rest.
         */
 -      switch (*rest) {
 +
        /* "." is not allowed */
 -      case '\0': case '/':
 +      if (*rest == '\0' || is_dir_sep(*rest))
                return 0;
  
 +      switch (*rest) {
        /*
         * ".git" followed by  NUL or slash is bad. This
         * shares the path end test with the ".." case.
                rest += 2;
        /* fallthrough */
        case '.':
 -              if (rest[1] == '\0' || rest[1] == '/')
 +              if (rest[1] == '\0' || is_dir_sep(rest[1]))
                        return 0;
        }
        return 1;
@@@ -754,19 -753,23 +754,19 @@@ int verify_path(const char *path
  {
        char c;
  
 +      if (has_dos_drive_prefix(path))
 +              return 0;
 +
        goto inside;
        for (;;) {
                if (!c)
                        return 1;
 -              if (c == '/') {
 +              if (is_dir_sep(c)) {
  inside:
                        c = *path++;
 -                      switch (c) {
 -                      default:
 -                              continue;
 -                      case '/': case '\0':
 -                              break;
 -                      case '.':
 -                              if (verify_dotfile(path))
 -                                      continue;
 -                      }
 -                      return 0;
 +                      if ((c == '.' && !verify_dotfile(path)) ||
 +                          is_dir_sep(c) || c == '\0')
 +                              return 0;
                }
                c = *path++;
        }
@@@ -1084,7 -1087,7 +1084,7 @@@ static void show_file(const char * fmt
  {
        if (in_porcelain && *first && header_msg) {
                printf("%s\n", header_msg);
-               *first=0;
+               *first = 0;
        }
        printf(fmt, name);
  }