Code

Merge branch 'jn/remote-set-branches'
authorJunio C Hamano <gitster@pobox.com>
Fri, 18 Jun 2010 18:16:55 +0000 (11:16 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 18 Jun 2010 18:16:55 +0000 (11:16 -0700)
* jn/remote-set-branches:
  Add git remote set-branches

Conflicts:
builtin/remote.c

1  2 
Documentation/git-remote.txt
builtin/remote.c
t/t5505-remote.sh

Simple merge
index 0e99a9957dad39ded17ce98de49b164fdb70eacd,c4d17b52bc7725c1e1c77e1ce3e2379729a924c4..4745957b9602ed9fe5c983de35ad74cc85e9b537
@@@ -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;
Simple merge