Merge branch 'jk/allow-fetch-onelevel-refname'

"git clone" would fail to clone from a repository that has a ref
directly under "refs/", e.g. "refs/stash", because different
validation paths do different things on such a refname.  Loosen the
client side's validation to allow such a ref.

* jk/allow-fetch-onelevel-refname:
  fetch-pack: do not filter out one-level refs
This commit is contained in:
Junio C Hamano 2014-01-27 10:44:13 -08:00
Родитель 63763273de 4c22408111
Коммит f583ace157
2 изменённых файлов: 12 добавлений и 1 удалений

Просмотреть файл

@ -506,7 +506,7 @@ static void filter_refs(struct fetch_pack_args *args,
next = ref->next;
if (!memcmp(ref->name, "refs/", 5) &&
check_refname_format(ref->name + 5, 0))
check_refname_format(ref->name, 0))
; /* trash */
else {
while (i < nr_sought) {

Просмотреть файл

@ -640,4 +640,15 @@ test_expect_success 'branchname D/F conflict resolved by --prune' '
test_cmp expect actual
'
test_expect_success 'fetching a one-level ref works' '
test_commit extra &&
git reset --hard HEAD^ &&
git update-ref refs/foo extra &&
git init one-level &&
(
cd one-level &&
git fetch .. HEAD refs/foo
)
'
test_done