On Wed, Apr 03, 2013 at 08:52:09AM -0700, John Koleszar wrote:

> +     SMART=smart
> +     git ls-remote public >expected &&  
> +     grep /$NS/ expected >/dev/null &&
> +     GET_BODY "info/refs" >actual &&
> +     test_cmp expected actual &&
> +     GET_BODY "info/refs?service=git-upload-pack" | grep /$NS/ >/dev/null &&
> +
> +     SMART=smart_namespace &&
> +     GIT_NAMESPACE=$NS && export GIT_NAMESPACE &&
> +     git ls-remote public >expected &&  
> +     ! grep /$NS/ expected>/dev/null &&
> +     GET_BODY "info/refs" >actual &&
> +     test_cmp expected actual &&
> +     ! (GET_BODY "info/refs?service=git-upload-pack" | grep /$NS/ >/dev/null)
> +)'

Hmm. This is testing just the ref advertisement. It would be nice to see
a complete transaction tested with namespaces turned on. Something like
this (squashed into your patch) seems to work for me:

diff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh
index 47eb769..9fd8bbf 100755
--- a/t/t5551-http-fetch.sh
+++ b/t/t5551-http-fetch.sh
@@ -162,6 +162,18 @@ test_expect_success 'invalid Content-Type rejected' '
        grep "not valid:" actual
 '
 
+test_expect_success 'create namespaced refs' '
+       test_commit namespaced &&
+       git push public HEAD:refs/namespaces/ns/refs/heads/master
+'
+
+test_expect_success 'clone respects namespace' '
+       git clone --bare "$HTTPD_URL/smart_namespace/repo.git" ns.git &&
+       echo namespaced >expect &&
+       git --git-dir=ns.git log -1 --format=%s >actual &&
+       test_cmp expect actual
+'
+
 test -n "$GIT_TEST_LONG" && test_set_prereq EXPENSIVE
 
 test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '

-Peff
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to