OSDN Git Service

Merge branch 'jk/allow-fetch-onelevel-refname'
authorJunio C Hamano <gitster@pobox.com>
Mon, 27 Jan 2014 18:44:13 +0000 (10:44 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 27 Jan 2014 18:44:14 +0000 (10:44 -0800)
"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

1  2 
fetch-pack.c
t/t5510-fetch.sh

diff --cc fetch-pack.c
Simple merge
@@@ -614,30 -512,15 +614,41 @@@ test_expect_success 'all boundary commi
        test_bundle_object_count .git/objects/pack/pack-${pack##pack    }.pack 3
  '
  
 +test_expect_success 'fetch --prune prints the remotes url' '
 +      git branch goodbye &&
 +      git clone . only-prunes &&
 +      git branch -D goodbye &&
 +      (
 +              cd only-prunes &&
 +              git fetch --prune origin 2>&1 | head -n1 >../actual
 +      ) &&
 +      echo "From ${D}/." >expect &&
 +      test_cmp expect actual
 +'
 +
 +test_expect_success 'branchname D/F conflict resolved by --prune' '
 +      git branch dir/file &&
 +      git clone . prune-df-conflict &&
 +      git branch -D dir/file &&
 +      git branch dir &&
 +      (
 +              cd prune-df-conflict &&
 +              git fetch --prune &&
 +              git rev-parse origin/dir >../actual
 +      ) &&
 +      git rev-parse dir >expect &&
 +      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