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>
This commit is contained in:
parent
f8aae12034
commit
1ce89cc4bb
@ -105,6 +105,7 @@ static int add(int argc, const char **argv)
|
|||||||
struct path_list_item *item = track.items + i;
|
struct path_list_item *item = track.items + i;
|
||||||
|
|
||||||
strbuf_reset(&buf2);
|
strbuf_reset(&buf2);
|
||||||
|
strbuf_addch(&buf2, '+');
|
||||||
if (mirror)
|
if (mirror)
|
||||||
strbuf_addf(&buf2, "refs/%s:refs/%s",
|
strbuf_addf(&buf2, "refs/%s:refs/%s",
|
||||||
item->path, item->path);
|
item->path, item->path);
|
||||||
|
@ -77,6 +77,16 @@ test_expect_success 'add another remote' '
|
|||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'remote forces tracking branches' '
|
||||||
|
(
|
||||||
|
cd test &&
|
||||||
|
case `git config remote.second.fetch` in
|
||||||
|
+*) true ;;
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
)
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'remove remote' '
|
test_expect_success 'remove remote' '
|
||||||
(
|
(
|
||||||
cd test &&
|
cd test &&
|
||||||
|
Loading…
Reference in New Issue
Block a user