From: Junio C Hamano Date: Thu, 25 Aug 2011 23:00:07 +0000 (-0700) Subject: Merge branch 'maint' X-Git-Tag: v1.7.7-rc0~10 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/1952e102b702b977d6bdfcee7cb48b843cb92049?ds=inline;hp=-c Merge branch 'maint' * maint: whitespace: have SP on both sides of an assignment "=" update-ref: whitespace fix --- 1952e102b702b977d6bdfcee7cb48b843cb92049 diff --combined builtin/remote.c index 05b1f5b76d,1fb441c964..f2a9c26dc3 --- a/builtin/remote.c +++ b/builtin/remote.c @@@ -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 46a9e60708,0a641034ce..01a0e25051 --- a/read-cache.c +++ b/read-cache.c @@@ -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. @@@ -744,7 -743,7 +744,7 @@@ 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); }