From: Junio C Hamano Date: Fri, 18 Jun 2010 18:16:55 +0000 (-0700) Subject: Merge branch 'jn/remote-set-branches' X-Git-Tag: v1.7.2-rc0~57 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=1c5d6b2a401576f74c76f56dae0204604235705c;p=git.git Merge branch 'jn/remote-set-branches' * jn/remote-set-branches: Add git remote set-branches Conflicts: builtin/remote.c --- 1c5d6b2a401576f74c76f56dae0204604235705c diff --cc builtin/remote.c index 0e99a9957,c4d17b52b..4745957b9 --- a/builtin/remote.c +++ b/builtin/remote.c @@@ -104,15 -111,23 +111,29 @@@ static int fetch_remote(const char *nam return 0; } +enum { + TAGS_UNSET = 0, + TAGS_DEFAULT = 1, + TAGS_SET = 2 +}; + + static int add_branch(const char *key, const char *branchname, + const char *remotename, int mirror, struct strbuf *tmp) + { + strbuf_reset(tmp); + strbuf_addch(tmp, '+'); + if (mirror) + strbuf_addf(tmp, "refs/%s:refs/%s", + branchname, branchname); + else + strbuf_addf(tmp, "refs/heads/%s:refs/remotes/%s/%s", + branchname, remotename, branchname); + return git_config_set_multivar(key, tmp->buf, "^$", 0); + } + static int add(int argc, const char **argv) { - int fetch = 0, mirror = 0; + int fetch = 0, mirror = 0, fetch_tags = TAGS_DEFAULT; struct string_list track = { NULL, 0, 0 }; const char *master = NULL; struct remote *remote;