@matheusbsbs / matheus-bagliano / commits / 1ce89cc4bb
Fork 0

remote: create fetch config lines with '+'

Since git-remote always uses remote tracking branches, it should be safe to always force updates of those branches. I.e., we should generate fetch = +refs/heads/*:refs/remotes/$remote/* instead of fetch = refs/heads/*:refs/remotes/$remote/* This was the behavior of the perl version, which seems to have been lost in the C rewrite. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Apr 22, 2008 at 07:11 UTC 1ce89cc4bb18b0e66f7073562d6634f6a9841335
2 files changed +11
builtin-remote.c
+1
@@ -105,6 +105,7 @@ static int add(int argc, const char **argv)
105 struct path_list_item *item = track.items + i;
106
107 strbuf_reset(&buf2);
108 + strbuf_addch(&buf2, '+');
109 if (mirror)
110 strbuf_addf(&buf2, "refs/%s:refs/%s",
111 item->path, item->path);
t/t5505-remote.sh
+10
@@ -77,6 +77,16 @@ test_expect_success 'add another remote' '
77 )
78 '
79
80 +test_expect_success 'remote forces tracking branches' '
81 +(
82 + cd test &&
83 + case `git config remote.second.fetch` in
84 + +*) true ;;
85 + *) false ;;
86 + esac
87 +)
88 +'
89 +
90 test_expect_success 'remove remote' '
91 (
92 cd test &&