Merge branch 'jk/maint-remote-mirror-safer'
authorJunio C Hamano <gitster@pobox.com>
Tue, 31 May 2011 19:08:52 +0000 (12:08 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 31 May 2011 19:08:52 +0000 (12:08 -0700)
* jk/maint-remote-mirror-safer:
remote: allow "-t" with fetch mirrors

1  2 
builtin/remote.c
diff --combined builtin/remote.c
index 8424152269e309cb86e4ff530b9feacc23fc17a6,aa7111824d9d19086752b1bc28d10515389e0ac3..9ff1cac69b9fd21c5f7dfc06b5859fedccc67644
@@@ -1,4 -1,4 +1,4 @@@
 -#include "cache.h"
 +#include "builtin.h"
  #include "parse-options.h"
  #include "transport.h"
  #include "remote.h"
@@@ -193,8 -193,8 +193,8 @@@ static int add(int argc, const char **a
  
        if (mirror && master)
                die("specifying a master branch makes no sense with --mirror");
-       if (mirror && track.nr)
-               die("specifying branches to track makes no sense with --mirror");
+       if (mirror && !(mirror & MIRROR_FETCH) && track.nr)
+               die("specifying branches to track makes sense only with fetch mirrors");
  
        name = argv[0];
        url = argv[1];