Merge branch 'jk/skip-http-tests-under-no-curl' into maint
authorJunio C Hamano <gitster@pobox.com>
Fri, 5 Jun 2015 19:00:28 +0000 (12:00 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 5 Jun 2015 19:00:28 +0000 (12:00 -0700)
Test clean-up.

* jk/skip-http-tests-under-no-curl:
tests: skip dav http-push tests under NO_EXPAT=NoThanks
t/lib-httpd.sh: skip tests if NO_CURL is defined

1  2 
Makefile
t/lib-httpd.sh
t/t5539-fetch-http-shallow.sh
t/t5541-http-push-smart.sh
t/t5550-http-fetch-dumb.sh
t/t5551-http-fetch-smart.sh
diff --combined Makefile
index 5f3987fe3bd945fb5a84c9f45a8de7da5581f79a,b9ebbf619e8deddeff72ad4edc8cfe8abddbf733..40a93c1a14d4c826253ef156f3c70265134d5122
+++ b/Makefile
@@@ -14,11 -14,11 +14,11 @@@ all:
  # Define INLINE to a suitable substitute (such as '__inline' or '') if git
  # fails to compile with errors about undefined inline functions or similar.
  #
 -# Define SNPRINTF_RETURNS_BOGUS if your are on a system which snprintf()
 +# Define SNPRINTF_RETURNS_BOGUS if you are on a system which snprintf()
  # or vsnprintf() return -1 instead of number of characters which would
  # have been written to the final string if enough space had been available.
  #
 -# Define FREAD_READS_DIRECTORIES if your are on a system which succeeds
 +# Define FREAD_READS_DIRECTORIES if you are on a system which succeeds
  # when attempting to read from an fopen'ed directory.
  #
  # Define NO_OPENSSL environment variable if you do not have OpenSSL.
@@@ -30,8 -30,6 +30,8 @@@
  # Define LIBPCREDIR=/foo/bar if your libpcre header and library files are in
  # /foo/bar/include and /foo/bar/lib directories.
  #
 +# Define HAVE_ALLOCA_H if you have working alloca(3) defined in that header.
 +#
  # Define NO_CURL if you do not have libcurl installed.  git-http-fetch and
  # git-http-push are not built, and you cannot use http:// and https://
  # transports (neither smart nor dumb).
  # Define NO_TRUSTABLE_FILEMODE if your filesystem may claim to support
  # the executable mode bit, but doesn't really do so.
  #
 +# Define NEEDS_MODE_TRANSLATION if your OS strays from the typical file type
 +# bits in mode values (e.g. z/OS defines I_SFMT to 0xFF000000 as opposed to the
 +# usual 0xF000).
 +#
  # Define NO_IPV6 if you lack IPv6 support and getaddrinfo().
  #
  # Define NO_UNIX_SOCKETS if your system does not offer unix sockets.
  # dependency rules.  The default is "auto", which means to use computed header
  # dependencies if your compiler is detected to support it.
  #
 -# Define CHECK_HEADER_DEPENDENCIES to check for problems in the hard-coded
 -# dependency rules.
 -#
  # Define NATIVE_CRLF if your platform uses CRLF for line endings.
  #
  # Define XDL_FAST_HASH to use an alternative line-hashing method in
  #
  # Define GMTIME_UNRELIABLE_ERRORS if your gmtime() function does not
  # return NULL when it receives a bogus time_t.
 +#
 +# Define HAVE_CLOCK_GETTIME if your platform has clock_gettime in librt.
 +#
 +# Define HAVE_CLOCK_MONOTONIC if your platform has CLOCK_MONOTONIC in librt.
 +#
 +# Define NO_HMAC_CTX_CLEANUP if your OpenSSL is version 0.9.6b or earlier to
 +# cleanup the HMAC context with the older HMAC_cleanup function.
 +#
 +# Define USE_PARENS_AROUND_GETTEXT_N to "yes" if your compiler happily
 +# compiles the following initialization:
 +#
 +#   static const char s[] = ("FOO");
 +#
 +# and define it to "no" if you need to remove the parentheses () around the
 +# constant.  The default is "auto", which means to use parentheses if your
 +# compiler is detected to support it.
 +#
 +# Define HAVE_BSD_SYSCTL if your platform has a BSD-compatible sysctl function.
  
  GIT-VERSION-FILE: FORCE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
@@@ -449,6 -428,7 +449,6 @@@ XDIFF_OBJS 
  VCSSVN_OBJS =
  GENERATED_H =
  EXTRA_CPPFLAGS =
 -LIB_H =
  LIB_OBJS =
  PROGRAM_OBJS =
  PROGRAMS =
@@@ -567,11 -547,9 +567,11 @@@ PROGRAMS += $(patsubst %.o,git-%$X,$(PR
  
  TEST_PROGRAMS_NEED_X += test-chmtime
  TEST_PROGRAMS_NEED_X += test-ctype
 +TEST_PROGRAMS_NEED_X += test-config
  TEST_PROGRAMS_NEED_X += test-date
  TEST_PROGRAMS_NEED_X += test-delta
  TEST_PROGRAMS_NEED_X += test-dump-cache-tree
 +TEST_PROGRAMS_NEED_X += test-dump-split-index
  TEST_PROGRAMS_NEED_X += test-genrandom
  TEST_PROGRAMS_NEED_X += test-hashmap
  TEST_PROGRAMS_NEED_X += test-index-version
@@@ -588,7 -566,6 +588,7 @@@ TEST_PROGRAMS_NEED_X += test-revision-w
  TEST_PROGRAMS_NEED_X += test-run-command
  TEST_PROGRAMS_NEED_X += test-scrap-cache-tree
  TEST_PROGRAMS_NEED_X += test-sha1
 +TEST_PROGRAMS_NEED_X += test-sha1-array
  TEST_PROGRAMS_NEED_X += test-sigchain
  TEST_PROGRAMS_NEED_X += test-string-list
  TEST_PROGRAMS_NEED_X += test-subprocess
@@@ -649,11 -626,130 +649,11 @@@ VCSSVN_LIB = vcs-svn/lib.
  
  GENERATED_H += common-cmds.h
  
 -LIB_H += advice.h
 -LIB_H += archive.h
 -LIB_H += argv-array.h
 -LIB_H += attr.h
 -LIB_H += bisect.h
 -LIB_H += blob.h
 -LIB_H += branch.h
 -LIB_H += builtin.h
 -LIB_H += bulk-checkin.h
 -LIB_H += bundle.h
 -LIB_H += cache-tree.h
 -LIB_H += cache.h
 -LIB_H += color.h
 -LIB_H += column.h
 -LIB_H += commit.h
 -LIB_H += compat/bswap.h
 -LIB_H += compat/mingw.h
 -LIB_H += compat/obstack.h
 -LIB_H += compat/poll/poll.h
 -LIB_H += compat/precompose_utf8.h
 -LIB_H += compat/terminal.h
 -LIB_H += compat/win32/dirent.h
 -LIB_H += compat/win32/pthread.h
 -LIB_H += compat/win32/syslog.h
 -LIB_H += connected.h
 -LIB_H += convert.h
 -LIB_H += credential.h
 -LIB_H += csum-file.h
 -LIB_H += decorate.h
 -LIB_H += delta.h
 -LIB_H += diff.h
 -LIB_H += diffcore.h
 -LIB_H += dir.h
 -LIB_H += exec_cmd.h
 -LIB_H += ewah/ewok.h
 -LIB_H += ewah/ewok_rlw.h
 -LIB_H += fetch-pack.h
 -LIB_H += fmt-merge-msg.h
 -LIB_H += fsck.h
 -LIB_H += gettext.h
 -LIB_H += git-compat-util.h
 -LIB_H += gpg-interface.h
 -LIB_H += graph.h
 -LIB_H += grep.h
 -LIB_H += hashmap.h
 -LIB_H += help.h
 -LIB_H += http.h
 -LIB_H += kwset.h
 -LIB_H += levenshtein.h
 -LIB_H += line-log.h
 -LIB_H += line-range.h
 -LIB_H += list-objects.h
 -LIB_H += ll-merge.h
 -LIB_H += log-tree.h
 -LIB_H += mailmap.h
 -LIB_H += merge-blobs.h
 -LIB_H += merge-recursive.h
 -LIB_H += mergesort.h
 -LIB_H += notes-cache.h
 -LIB_H += notes-merge.h
 -LIB_H += notes-utils.h
 -LIB_H += notes.h
 -LIB_H += object.h
 -LIB_H += pack-objects.h
 -LIB_H += pack-revindex.h
 -LIB_H += pack.h
 -LIB_H += pack-bitmap.h
 -LIB_H += parse-options.h
 -LIB_H += patch-ids.h
 -LIB_H += pathspec.h
 -LIB_H += pkt-line.h
 -LIB_H += prio-queue.h
 -LIB_H += progress.h
 -LIB_H += prompt.h
 -LIB_H += quote.h
 -LIB_H += reachable.h
 -LIB_H += reflog-walk.h
 -LIB_H += refs.h
 -LIB_H += remote.h
 -LIB_H += rerere.h
 -LIB_H += resolve-undo.h
 -LIB_H += revision.h
 -LIB_H += run-command.h
 -LIB_H += send-pack.h
 -LIB_H += sequencer.h
 -LIB_H += sha1-array.h
 -LIB_H += sha1-lookup.h
 -LIB_H += shortlog.h
 -LIB_H += sideband.h
 -LIB_H += sigchain.h
 -LIB_H += strbuf.h
 -LIB_H += streaming.h
 -LIB_H += string-list.h
 -LIB_H += submodule.h
 -LIB_H += tag.h
 -LIB_H += tar.h
 -LIB_H += thread-utils.h
 -LIB_H += transport.h
 -LIB_H += tree-walk.h
 -LIB_H += tree.h
 -LIB_H += unpack-trees.h
 -LIB_H += url.h
 -LIB_H += urlmatch.h
 -LIB_H += userdiff.h
 -LIB_H += utf8.h
 -LIB_H += varint.h
 -LIB_H += vcs-svn/fast_export.h
 -LIB_H += vcs-svn/line_buffer.h
 -LIB_H += vcs-svn/repo_tree.h
 -LIB_H += vcs-svn/sliding_window.h
 -LIB_H += vcs-svn/svndiff.h
 -LIB_H += vcs-svn/svndump.h
 -LIB_H += walker.h
 -LIB_H += wildmatch.h
 -LIB_H += wt-status.h
 -LIB_H += xdiff-interface.h
 -LIB_H += xdiff/xdiff.h
 -LIB_H += xdiff/xdiffi.h
 -LIB_H += xdiff/xemit.h
 -LIB_H += xdiff/xinclude.h
 -LIB_H += xdiff/xmacros.h
 -LIB_H += xdiff/xprepare.h
 -LIB_H += xdiff/xtypes.h
 -LIB_H += xdiff/xutils.h
 +LIB_H = $(shell $(FIND) . \
 +      -name .git -prune -o \
 +      -name t -prune -o \
 +      -name Documentation -prune -o \
 +      -name '*.h' -print)
  
  LIB_OBJS += abspath.o
  LIB_OBJS += advice.o
@@@ -776,7 -872,6 +776,7 @@@ LIB_OBJS += sha1_name.
  LIB_OBJS += shallow.o
  LIB_OBJS += sideband.o
  LIB_OBJS += sigchain.o
 +LIB_OBJS += split-index.o
  LIB_OBJS += strbuf.o
  LIB_OBJS += streaming.o
  LIB_OBJS += string-list.o
@@@ -784,7 -879,6 +784,7 @@@ LIB_OBJS += submodule.
  LIB_OBJS += symlinks.o
  LIB_OBJS += tag.o
  LIB_OBJS += trace.o
 +LIB_OBJS += trailer.o
  LIB_OBJS += transport.o
  LIB_OBJS += transport-helper.o
  LIB_OBJS += tree-diff.o
@@@ -849,7 -943,6 +849,7 @@@ BUILTIN_OBJS += builtin/hash-object.
  BUILTIN_OBJS += builtin/help.o
  BUILTIN_OBJS += builtin/index-pack.o
  BUILTIN_OBJS += builtin/init-db.o
 +BUILTIN_OBJS += builtin/interpret-trailers.o
  BUILTIN_OBJS += builtin/log.o
  BUILTIN_OBJS += builtin/ls-files.o
  BUILTIN_OBJS += builtin/ls-remote.o
@@@ -903,7 -996,6 +903,7 @@@ BUILTIN_OBJS += builtin/update-ref.
  BUILTIN_OBJS += builtin/update-server-info.o
  BUILTIN_OBJS += builtin/upload-archive.o
  BUILTIN_OBJS += builtin/var.o
 +BUILTIN_OBJS += builtin/verify-commit.o
  BUILTIN_OBJS += builtin/verify-pack.o
  BUILTIN_OBJS += builtin/verify-tag.o
  BUILTIN_OBJS += builtin/write-tree.o
@@@ -925,6 -1017,11 +925,6 @@@ sysconfdir = et
  endif
  endif
  
 -ifdef CHECK_HEADER_DEPENDENCIES
 -COMPUTE_HEADER_DEPENDENCIES = no
 -USE_COMPUTED_HEADER_DEPENDENCIES =
 -endif
 -
  ifndef COMPUTE_HEADER_DEPENDENCIES
  COMPUTE_HEADER_DEPENDENCIES = auto
  endif
@@@ -966,14 -1063,6 +966,14 @@@ ifneq (,$(SOCKLEN_T)
        BASIC_CFLAGS += -Dsocklen_t=$(SOCKLEN_T)
  endif
  
 +ifeq (yes,$(USE_PARENS_AROUND_GETTEXT_N))
 +      BASIC_CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=1
 +else
 +ifeq (no,$(USE_PARENS_AROUND_GETTEXT_N))
 +      BASIC_CFLAGS += -DUSE_PARENS_AROUND_GETTEXT_N=0
 +endif
 +endif
 +
  ifeq ($(uname_S),Darwin)
        ifndef NO_FINK
                ifeq ($(shell test -d /sw/lib && echo y),y)
@@@ -1019,13 -1108,6 +1019,13 @@@ ifdef USE_LIBPCR
        EXTLIBS += -lpcre
  endif
  
 +ifdef HAVE_ALLOCA_H
 +      BASIC_CFLAGS += -DHAVE_ALLOCA_H
 +endif
 +
 +IMAP_SEND_BUILDDEPS =
 +IMAP_SEND_LDFLAGS = $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
 +
  ifdef NO_CURL
        BASIC_CFLAGS += -DNO_CURL
        REMOTE_CURL_PRIMARY =
        REMOTE_CURL_NAMES = $(REMOTE_CURL_PRIMARY) $(REMOTE_CURL_ALIASES)
        PROGRAM_OBJS += http-fetch.o
        PROGRAMS += $(REMOTE_CURL_NAMES)
 -      curl_check := $(shell (echo 070908; curl-config --vernum) 2>/dev/null | sort -r | sed -ne 2p)
 +      curl_check := $(shell (echo 070908; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
        ifeq "$(curl_check)" "070908"
                ifndef NO_EXPAT
                        PROGRAM_OBJS += http-push.o
                endif
        endif
 +      curl_check := $(shell (echo 072200; curl-config --vernum | sed -e '/^70[BC]/s/^/0/') 2>/dev/null | sort -r | sed -ne 2p)
 +      ifeq "$(curl_check)" "072200"
 +              USE_CURL_FOR_IMAP_SEND = YesPlease
 +      endif
 +      ifdef USE_CURL_FOR_IMAP_SEND
 +              BASIC_CFLAGS += -DUSE_CURL_FOR_IMAP_SEND
 +              IMAP_SEND_BUILDDEPS = http.o
 +              IMAP_SEND_LDFLAGS += $(CURL_LIBCURL)
 +      endif
        ifndef NO_EXPAT
                ifdef EXPATDIR
                        BASIC_CFLAGS += -I$(EXPATDIR)/include
@@@ -1099,9 -1172,6 +1099,9 @@@ ifndef NO_OPENSS
        ifdef NEEDS_CRYPTO_WITH_SSL
                OPENSSL_LIBSSL += -lcrypto
        endif
 +      ifdef NO_HMAC_CTX_CLEANUP
 +              BASIC_CFLAGS += -DNO_HMAC_CTX_CLEANUP
 +      endif
  else
        BASIC_CFLAGS += -DNO_OPENSSL
        BLK_SHA1 = 1
@@@ -1273,10 -1343,6 +1273,10 @@@ endi
  ifdef NO_TRUSTABLE_FILEMODE
        BASIC_CFLAGS += -DNO_TRUSTABLE_FILEMODE
  endif
 +ifdef NEEDS_MODE_TRANSLATION
 +      COMPAT_CFLAGS += -DNEEDS_MODE_TRANSLATION
 +      COMPAT_OBJS += compat/stat.o
 +endif
  ifdef NO_IPV6
        BASIC_CFLAGS += -DNO_IPV6
  endif
@@@ -1303,6 -1369,7 +1303,6 @@@ ifdef NO_INET_PTO
  endif
  ifndef NO_UNIX_SOCKETS
        LIB_OBJS += unix-socket.o
 -      LIB_H += unix-socket.h
        PROGRAM_OBJS += credential-cache.o
        PROGRAM_OBJS += credential-cache--daemon.o
  endif
@@@ -1326,10 -1393,12 +1326,10 @@@ endi
  ifdef BLK_SHA1
        SHA1_HEADER = "block-sha1/sha1.h"
        LIB_OBJS += block-sha1/sha1.o
 -      LIB_H += block-sha1/sha1.h
  else
  ifdef PPC_SHA1
        SHA1_HEADER = "ppc/sha1.h"
        LIB_OBJS += ppc/sha1.o ppc/sha1ppc.o
 -      LIB_H += ppc/sha1.h
  else
  ifdef APPLE_COMMON_CRYPTO
        COMPAT_CFLAGS += -DCOMMON_DIGEST_FOR_OPENSSL
@@@ -1398,9 -1467,6 +1398,9 @@@ ifdef NO_REGE
        COMPAT_CFLAGS += -Icompat/regex
        COMPAT_OBJS += compat/regex/regex.o
  endif
 +ifdef NATIVE_CRLF
 +      BASIC_CFLAGS += -DNATIVE_CRLF
 +endif
  
  ifdef USE_NED_ALLOCATOR
         COMPAT_CFLAGS += -Icompat/nedmalloc
@@@ -1424,19 -1490,6 +1424,19 @@@ ifdef GMTIME_UNRELIABLE_ERROR
        BASIC_CFLAGS += -DGMTIME_UNRELIABLE_ERRORS
  endif
  
 +ifdef HAVE_CLOCK_GETTIME
 +      BASIC_CFLAGS += -DHAVE_CLOCK_GETTIME
 +      EXTLIBS += -lrt
 +endif
 +
 +ifdef HAVE_CLOCK_MONOTONIC
 +      BASIC_CFLAGS += -DHAVE_CLOCK_MONOTONIC
 +endif
 +
 +ifdef HAVE_BSD_SYSCTL
 +      BASIC_CFLAGS += -DHAVE_BSD_SYSCTL
 +endif
 +
  ifeq ($(TCLTK_PATH),)
  NO_TCLTK = NoThanks
  endif
@@@ -1492,13 -1545,13 +1492,13 @@@ endi
  PROFILE_DIR := $(CURDIR)
  
  ifeq ("$(PROFILE)","GEN")
 -      CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=1
 +      BASIC_CFLAGS += -fprofile-generate=$(PROFILE_DIR) -DNO_NORETURN=1
        EXTLIBS += -lgcov
        export CCACHE_DISABLE = t
        V = 1
  else
  ifneq ("$(PROFILE)","")
 -      CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1
 +      BASIC_CFLAGS += -fprofile-use=$(PROFILE_DIR) -fprofile-correction -DNO_NORETURN=1
        export CCACHE_DISABLE = t
        V = 1
  endif
@@@ -1583,24 -1636,12 +1583,24 @@@ SHELL = $(SHELL_PATH
  all:: shell_compatibility_test
  
  ifeq "$(PROFILE)" "BUILD"
 -ifeq ($(filter all,$(MAKECMDGOALS)),all)
 -all:: profile-clean
 +all:: profile
 +endif
 +
 +profile:: profile-clean
        $(MAKE) PROFILE=GEN all
        $(MAKE) PROFILE=GEN -j1 test
 -endif
 -endif
 +      @if test -n "$$GIT_PERF_REPO" || test -d .git; then \
 +              $(MAKE) PROFILE=GEN -j1 perf; \
 +      else \
 +              echo "Skipping profile of perf tests..."; \
 +      fi
 +      $(MAKE) PROFILE=USE all
 +
 +profile-fast: profile-clean
 +      $(MAKE) PROFILE=GEN all
 +      $(MAKE) PROFILE=GEN -j1 perf
 +      $(MAKE) PROFILE=USE all
 +
  
  all:: $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS) GIT-BUILD-OPTIONS
  ifneq (,$X)
@@@ -1665,8 -1706,8 +1665,8 @@@ git.sp git.s git.o: EXTRA_CPPFLAGS = 
        '-DGIT_INFO_PATH="$(infodir_relative_SQ)"'
  
  git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
 -      $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ git.o \
 -              $(BUILTIN_OBJS) $(ALL_LDFLAGS) $(LIBS)
 +      $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) git.o \
 +              $(BUILTIN_OBJS) $(LIBS)
  
  help.sp help.s help.o: common-cmds.h
  
@@@ -1717,7 -1758,7 +1717,7 @@@ GIT-SCRIPT-DEFINES: FORC
              fi
  
  
 -$(patsubst %.sh,%,$(SCRIPT_SH)) : % : %.sh GIT-SCRIPT-DEFINES
 +$(SCRIPT_SH_GEN) : % : %.sh GIT-SCRIPT-DEFINES
        $(QUIET_GEN)$(cmd_munge_script) && \
        chmod +x $@+ && \
        mv $@+ $@
@@@ -1731,11 -1772,8 +1731,11 @@@ git.res: git.rc GIT-VERSION-FIL
          $(join -DMAJOR= -DMINOR=, $(wordlist 1,2,$(subst -, ,$(subst ., ,$(GIT_VERSION))))) \
          -DGIT_VERSION="\\\"$(GIT_VERSION)\\\"" $< -o $@
  
 +# This makes sure we depend on the NO_PERL setting itself.
 +$(SCRIPT_PERL_GEN): GIT-BUILD-OPTIONS
 +
  ifndef NO_PERL
 -$(patsubst %.perl,%,$(SCRIPT_PERL)): perl/perl.mak
 +$(SCRIPT_PERL_GEN): perl/perl.mak
  
  perl/perl.mak: perl/PM.stamp
  
@@@ -1748,7 -1786,7 +1748,7 @@@ perl/perl.mak: GIT-CFLAGS GIT-PREFIX pe
        $(QUIET_SUBDIR0)perl $(QUIET_SUBDIR1) PERL_PATH='$(PERL_PATH_SQ)' prefix='$(prefix_SQ)' $(@F)
  
  PERL_DEFINES = $(PERL_PATH_SQ):$(PERLLIB_EXTRA_SQ)
 -$(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl perl/perl.mak GIT-PERL-DEFINES GIT-VERSION-FILE
 +$(SCRIPT_PERL_GEN): % : %.perl perl/perl.mak GIT-PERL-DEFINES GIT-VERSION-FILE
        $(QUIET_GEN)$(RM) $@ $@+ && \
        INSTLIBDIR=`MAKEFLAGS= $(MAKE) -C perl -s --no-print-directory instlibdir` && \
        INSTLIBDIR_EXTRA='$(PERLLIB_EXTRA_SQ)' && \
@@@ -1782,7 -1820,7 +1782,7 @@@ git-instaweb: git-instaweb.sh gitweb GI
        chmod +x $@+ && \
        mv $@+ $@
  else # NO_PERL
 -$(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh
 +$(SCRIPT_PERL_GEN) git-instaweb: % : unimplemented.sh
        $(QUIET_GEN)$(RM) $@ $@+ && \
        sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
            -e 's|@@REASON@@|NO_PERL=$(NO_PERL)|g' \
        mv $@+ $@
  endif # NO_PERL
  
 +# This makes sure we depend on the NO_PYTHON setting itself.
 +$(SCRIPT_PYTHON_GEN): GIT-BUILD-OPTIONS
 +
  ifndef NO_PYTHON
  $(SCRIPT_PYTHON_GEN): GIT-CFLAGS GIT-PREFIX GIT-PYTHON-VARS
  $(SCRIPT_PYTHON_GEN): % : %.py
@@@ -1873,13 -1908,29 +1873,13 @@@ $(dep_dirs)
  missing_dep_dirs := $(filter-out $(wildcard $(dep_dirs)),$(dep_dirs))
  dep_file = $(dir $@).depend/$(notdir $@).d
  dep_args = -MF $(dep_file) -MQ $@ -MMD -MP
 -ifdef CHECK_HEADER_DEPENDENCIES
 -$(error cannot compute header dependencies outside a normal build. \
 -Please unset CHECK_HEADER_DEPENDENCIES and try again)
 -endif
  endif
  
  ifneq ($(COMPUTE_HEADER_DEPENDENCIES),yes)
 -ifndef CHECK_HEADER_DEPENDENCIES
  dep_dirs =
  missing_dep_dirs =
  dep_args =
  endif
 -endif
 -
 -ifdef CHECK_HEADER_DEPENDENCIES
 -ifndef PRINT_HEADER_DEPENDENCIES
 -missing_deps = $(filter-out $(notdir $^), \
 -      $(notdir $(shell $(MAKE) -s $@ \
 -              CHECK_HEADER_DEPENDENCIES=YesPlease \
 -              USE_COMPUTED_HEADER_DEPENDENCIES=YesPlease \
 -              PRINT_HEADER_DEPENDENCIES=YesPlease)))
 -endif
 -endif
  
  ASM_SRC := $(wildcard $(OBJECTS:o=S))
  ASM_OBJ := $(ASM_SRC:S=o)
@@@ -1887,10 -1938,45 +1887,10 @@@ C_OBJ := $(filter-out $(ASM_OBJ),$(OBJE
  
  .SUFFIXES:
  
 -ifdef PRINT_HEADER_DEPENDENCIES
 -$(C_OBJ): %.o: %.c FORCE
 -      echo $^
 -$(ASM_OBJ): %.o: %.S FORCE
 -      echo $^
 -
 -ifndef CHECK_HEADER_DEPENDENCIES
 -$(error cannot print header dependencies during a normal build. \
 -Please set CHECK_HEADER_DEPENDENCIES and try again)
 -endif
 -endif
 -
 -ifndef PRINT_HEADER_DEPENDENCIES
 -ifdef CHECK_HEADER_DEPENDENCIES
 -$(C_OBJ): %.o: %.c $(dep_files) FORCE
 -      @set -e; echo CHECK $@; \
 -      missing_deps="$(missing_deps)"; \
 -      if test "$$missing_deps"; \
 -      then \
 -              echo missing dependencies: $$missing_deps; \
 -              false; \
 -      fi
 -$(ASM_OBJ): %.o: %.S $(dep_files) FORCE
 -      @set -e; echo CHECK $@; \
 -      missing_deps="$(missing_deps)"; \
 -      if test "$$missing_deps"; \
 -      then \
 -              echo missing dependencies: $$missing_deps; \
 -              false; \
 -      fi
 -endif
 -endif
 -
 -ifndef CHECK_HEADER_DEPENDENCIES
  $(C_OBJ): %.o: %.c GIT-CFLAGS $(missing_dep_dirs)
        $(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
  $(ASM_OBJ): %.o: %.S GIT-CFLAGS $(missing_dep_dirs)
        $(QUIET_CC)$(CC) -o $*.o -c $(dep_args) $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
 -endif
  
  %.s: %.c GIT-CFLAGS FORCE
        $(QUIET_CC)$(CC) -o $@ -S $(ALL_CFLAGS) $(EXTRA_CPPFLAGS) $<
@@@ -1935,7 -2021,7 +1935,7 @@@ gettext.sp gettext.s gettext.o: GIT-PRE
  gettext.sp gettext.s gettext.o: EXTRA_CPPFLAGS = \
        -DGIT_LOCALE_PATH='"$(localedir_SQ)"'
  
 -http-push.sp http.sp http-walker.sp remote-curl.sp: SPARSE_FLAGS += \
 +http-push.sp http.sp http-walker.sp remote-curl.sp imap-send.sp: SPARSE_FLAGS += \
        -DCURL_DISABLE_TYPECHECK
  
  ifdef NO_EXPAT
@@@ -1956,9 -2042,9 +1956,9 @@@ endi
  git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
  
 -git-imap-send$X: imap-send.o GIT-LDFLAGS $(GITLIBS)
 +git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
 -              $(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
 +              $(LIBS) $(IMAP_SEND_LDFLAGS)
  
  git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
        $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
@@@ -2017,9 -2103,9 +2017,9 @@@ XGETTEXT_FLAGS_C = $(XGETTEXT_FLAGS) --
  XGETTEXT_FLAGS_SH = $(XGETTEXT_FLAGS) --language=Shell \
        --keyword=gettextln --keyword=eval_gettextln
  XGETTEXT_FLAGS_PERL = $(XGETTEXT_FLAGS) --keyword=__ --language=Perl
 -LOCALIZED_C := $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
 -LOCALIZED_SH := $(SCRIPT_SH)
 -LOCALIZED_PERL := $(SCRIPT_PERL)
 +LOCALIZED_C = $(C_OBJ:o=c) $(LIB_H) $(GENERATED_H)
 +LOCALIZED_SH = $(SCRIPT_SH)
 +LOCALIZED_PERL = $(SCRIPT_PERL)
  
  ifdef XGETTEXT_INCLUDE_TESTS
  LOCALIZED_C += t/t0200/test.c
@@@ -2027,7 -2113,7 +2027,7 @@@ LOCALIZED_SH += t/t0200/test.s
  LOCALIZED_PERL += t/t0200/test.perl
  endif
  
 -po/git.pot: $(LOCALIZED_C)
 +po/git.pot: $(GENERATED_H) FORCE
        $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ $(XGETTEXT_FLAGS_C) $(LOCALIZED_C)
        $(QUIET_XGETTEXT)$(XGETTEXT) -o$@+ --join-existing $(XGETTEXT_FLAGS_SH) \
                $(LOCALIZED_SH)
@@@ -2102,6 -2188,7 +2102,7 @@@ GIT-BUILD-OPTIONS: FORC
        @echo PYTHON_PATH=\''$(subst ','\'',$(PYTHON_PATH_SQ))'\' >>$@
        @echo TAR=\''$(subst ','\'',$(subst ','\'',$(TAR)))'\' >>$@
        @echo NO_CURL=\''$(subst ','\'',$(subst ','\'',$(NO_CURL)))'\' >>$@
+       @echo NO_EXPAT=\''$(subst ','\'',$(subst ','\'',$(NO_EXPAT)))'\' >>$@
        @echo USE_LIBPCRE=\''$(subst ','\'',$(subst ','\'',$(USE_LIBPCRE)))'\' >>$@
        @echo NO_PERL=\''$(subst ','\'',$(subst ','\'',$(NO_PERL)))'\' >>$@
        @echo NO_PYTHON=\''$(subst ','\'',$(subst ','\'',$(NO_PYTHON)))'\' >>$@
@@@ -2242,12 -2329,6 +2243,12 @@@ mergetools_instdir_SQ = $(subst ','\'',
  
  install_bindir_programs := $(patsubst %,%$X,$(BINDIR_PROGRAMS_NEED_X)) $(BINDIR_PROGRAMS_NO_X)
  
 +profile-install: profile
 +      $(MAKE) install
 +
 +profile-fast-install: profile-fast
 +      $(MAKE) install
 +
  install: all
        $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(bindir_SQ)'
        $(INSTALL) -d -m 755 '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
diff --combined t/lib-httpd.sh
index e6adf2f82d59027279e06e0d273e719226d82184,d823664c57019dd26a77493eaf62486f85091070..e9714467d05e57eded6f37c3d5f07b91f63cc9fc
  # Copyright (c) 2008 Clemens Buchacher <drizzd@aon.at>
  #
  
+ if test -n "$NO_CURL"
+ then
+       skip_all='skipping test, git built without http support'
+       test_done
+ fi
+ if test -n "$NO_EXPAT" && test -n "$LIB_HTTPD_DAV"
+ then
+       skip_all='skipping test, git built without expat support'
+       test_done
+ fi
  test_tristate GIT_TEST_HTTPD
  if test "$GIT_TEST_HTTPD" = false
  then
        test_done
  fi
  
 +if ! test_have_prereq NOT_ROOT; then
 +      test_skip_or_die $GIT_TEST_HTTPD \
 +              "Cannot run httpd tests as root"
 +fi
 +
  HTTPD_PARA=""
  
  for DEFAULT_HTTPD_PATH in '/usr/sbin/httpd' '/usr/sbin/apache2'
@@@ -79,7 -86,6 +91,7 @@@ HTTPD_DOCUMENT_ROOT_PATH=$HTTPD_ROOT_PA
  # hack to suppress apache PassEnv warnings
  GIT_VALGRIND=$GIT_VALGRIND; export GIT_VALGRIND
  GIT_VALGRIND_OPTIONS=$GIT_VALGRIND_OPTIONS; export GIT_VALGRIND_OPTIONS
 +GIT_TRACE=$GIT_TRACE; export GIT_TRACE
  
  if ! test -x "$LIB_HTTPD_PATH"
  then
@@@ -111,15 -117,10 +123,15 @@@ els
                "Could not identify web server at '$LIB_HTTPD_PATH'"
  fi
  
 +install_script () {
 +      write_script "$HTTPD_ROOT_PATH/$1" <"$TEST_PATH/$1"
 +}
 +
  prepare_httpd() {
        mkdir -p "$HTTPD_DOCUMENT_ROOT_PATH"
        cp "$TEST_PATH"/passwd "$HTTPD_ROOT_PATH"
 -      cp "$TEST_PATH"/broken-smart-http.sh "$HTTPD_ROOT_PATH"
 +      install_script broken-smart-http.sh
 +      install_script error.sh
  
        ln -s "$LIB_HTTPD_MODULE_PATH" "$HTTPD_ROOT_PATH/modules"
  
        HTTPD_URL_USER=$HTTPD_PROTO://user%40host@$HTTPD_DEST
        HTTPD_URL_USER_PASS=$HTTPD_PROTO://user%40host:pass%40host@$HTTPD_DEST
  
 -      if test -n "$LIB_HTTPD_DAV" -o -n "$LIB_HTTPD_SVN"
 +      if test -n "$LIB_HTTPD_DAV" || test -n "$LIB_HTTPD_SVN"
        then
                HTTPD_PARA="$HTTPD_PARA -DDAV"
  
index b46118846ca9950684ff3880179ca467253a7970,f1cbf966993861c005624542aafadc280312486e..37a433504e27f8dffc9bbbb9e94d550de20ff035
@@@ -3,12 -3,6 +3,6 @@@
  test_description='fetch/clone from a shallow clone over http'
  
  . ./test-lib.sh
- if test -n "$NO_CURL"; then
-       skip_all='skipping test, git built without http support'
-       test_done
- fi
  . "$TEST_DIRECTORY"/lib-httpd.sh
  start_httpd
  
@@@ -54,7 -48,6 +48,7 @@@ EO
  test_expect_success 'no shallow lines after receiving ACK ready' '
        (
                cd shallow &&
 +              test_tick &&
                for i in $(test_seq 15)
                do
                        git checkout --orphan unrelated$i &&
index 9cf27e8c9924770b619b8e21fb22b5225e5f085f,2d378f5afcf3abde71e0bb52dc73a76132984af2..fd7d06b9a23664d0e20cc32a03955ff8816cac7f
@@@ -6,13 -6,7 +6,8 @@@
  test_description='test smart pushing over http via http-backend'
  . ./test-lib.sh
  
- if test -n "$NO_CURL"; then
-       skip_all='skipping test, git built without http support'
-       test_done
- fi
  ROOT_PATH="$PWD"
 +. "$TEST_DIRECTORY"/lib-gpg.sh
  . "$TEST_DIRECTORY"/lib-httpd.sh
  . "$TEST_DIRECTORY"/lib-terminal.sh
  start_httpd
@@@ -158,7 -152,7 +153,7 @@@ test_http_push_nonff "$HTTPD_DOCUMENT_R
  test_expect_success 'push fails for non-fast-forward refs unmatched by remote helper' '
        # create a dissimilarly-named remote ref so that git is unable to match the
        # two refs (viz. local, remote) unless an explicit refspec is provided.
 -      git push origin master:retsam
 +      git push origin master:retsam &&
  
        echo "change changed" > path2 &&
        git commit -a -m path2 --amend &&
@@@ -324,54 -318,5 +319,54 @@@ test_expect_success 'push into half-aut
        test_cmp expect actual
  '
  
 +test_expect_success CMDLINE_LIMIT 'push 2000 tags over http' '
 +      sha1=$(git rev-parse HEAD) &&
 +      test_seq 2000 |
 +        sort |
 +        sed "s|.*|$sha1 refs/tags/really-long-tag-name-&|" \
 +        >.git/packed-refs &&
 +      run_with_limited_cmdline git push --mirror
 +'
 +
 +test_expect_success GPG 'push with post-receive to inspect certificate' '
 +      (
 +              cd "$HTTPD_DOCUMENT_ROOT_PATH"/test_repo.git &&
 +              mkdir -p hooks &&
 +              write_script hooks/post-receive <<-\EOF &&
 +              # discard the update list
 +              cat >/dev/null
 +              # record the push certificate
 +              if test -n "${GIT_PUSH_CERT-}"
 +              then
 +                      git cat-file blob $GIT_PUSH_CERT >../push-cert
 +              fi &&
 +              cat >../push-cert-status <<E_O_F
 +              SIGNER=${GIT_PUSH_CERT_SIGNER-nobody}
 +              KEY=${GIT_PUSH_CERT_KEY-nokey}
 +              STATUS=${GIT_PUSH_CERT_STATUS-nostatus}
 +              NONCE_STATUS=${GIT_PUSH_CERT_NONCE_STATUS-nononcestatus}
 +              NONCE=${GIT_PUSH_CERT_NONCE-nononce}
 +              E_O_F
 +              EOF
 +
 +              git config receive.certnonceseed sekrit &&
 +              git config receive.certnonceslop 30
 +      ) &&
 +      cd "$ROOT_PATH/test_repo_clone" &&
 +      test_commit cert-test &&
 +      git push --signed "$HTTPD_URL/smart/test_repo.git" &&
 +      (
 +              cd "$HTTPD_DOCUMENT_ROOT_PATH" &&
 +              cat <<-\EOF &&
 +              SIGNER=C O Mitter <committer@example.com>
 +              KEY=13B6F51ECDDE430D
 +              STATUS=G
 +              NONCE_STATUS=OK
 +              EOF
 +              sed -n -e "s/^nonce /NONCE=/p" -e "/^$/q" push-cert
 +      ) >expect &&
 +      test_cmp expect "$HTTPD_DOCUMENT_ROOT_PATH/push-cert-status"
 +'
 +
  stop_httpd
  test_done
index 3d11b7a6bb660f3758bdf12dff06e31be04de9eb,2d9249cf90e6c6770cc282a7c7159d343d7aa0d4..87a7aa04aeb452c162dc5585efd0ec13195ea80a
@@@ -2,12 -2,6 +2,6 @@@
  
  test_description='test dumb fetching over http via static file'
  . ./test-lib.sh
- if test -n "$NO_CURL"; then
-       skip_all='skipping test, git built without http support'
-       test_done
- fi
  . "$TEST_DIRECTORY"/lib-httpd.sh
  start_httpd
  
@@@ -15,7 -9,7 +9,7 @@@ test_expect_success 'setup repository' 
        git config push.default matching &&
        echo content1 >file &&
        git add file &&
 -      git commit -m one
 +      git commit -m one &&
        echo content2 >file &&
        git add file &&
        git commit -m two
@@@ -165,96 -159,11 +159,96 @@@ test_expect_success 'fetch notices corr
        )
  '
  
 +test_expect_success 'fetch can handle previously-fetched .idx files' '
 +      git checkout --orphan branch1 &&
 +      echo base >file &&
 +      git add file &&
 +      git commit -m base &&
 +      git --bare init "$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git &&
 +      git push "$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git branch1 &&
 +      git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git repack -d &&
 +      git checkout -b branch2 branch1 &&
 +      echo b2 >>file &&
 +      git commit -a -m b2 &&
 +      git push "$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git branch2 &&
 +      git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH"/repo_packed_branches.git repack -d &&
 +      git --bare init clone_packed_branches.git &&
 +      git --git-dir=clone_packed_branches.git fetch "$HTTPD_URL"/dumb/repo_packed_branches.git branch1:branch1 &&
 +      git --git-dir=clone_packed_branches.git fetch "$HTTPD_URL"/dumb/repo_packed_branches.git branch2:branch2
 +'
 +
  test_expect_success 'did not use upload-pack service' '
 -      grep '/git-upload-pack' <"$HTTPD_ROOT_PATH"/access.log >act
 -      : >exp
 +      test_might_fail grep '/git-upload-pack' <"$HTTPD_ROOT_PATH"/access.log >act &&
 +      : >exp &&
        test_cmp exp act
  '
  
 +test_expect_success 'git client shows text/plain errors' '
 +      test_must_fail git clone "$HTTPD_URL/error/text" 2>stderr &&
 +      grep "this is the error message" stderr
 +'
 +
 +test_expect_success 'git client does not show html errors' '
 +      test_must_fail git clone "$HTTPD_URL/error/html" 2>stderr &&
 +      ! grep "this is the error message" stderr
 +'
 +
 +test_expect_success 'git client shows text/plain with a charset' '
 +      test_must_fail git clone "$HTTPD_URL/error/charset" 2>stderr &&
 +      grep "this is the error message" stderr
 +'
 +
 +test_expect_success 'http error messages are reencoded' '
 +      test_must_fail git clone "$HTTPD_URL/error/utf16" 2>stderr &&
 +      grep "this is the error message" stderr
 +'
 +
 +test_expect_success 'reencoding is robust to whitespace oddities' '
 +      test_must_fail git clone "$HTTPD_URL/error/odd-spacing" 2>stderr &&
 +      grep "this is the error message" stderr
 +'
 +
 +check_language () {
 +      case "$2" in
 +      '')
 +              >expect
 +              ;;
 +      ?*)
 +              echo "Accept-Language: $1" >expect
 +              ;;
 +      esac &&
 +      GIT_CURL_VERBOSE=1 \
 +      LANGUAGE=$2 \
 +      git ls-remote "$HTTPD_URL/dumb/repo.git" >output 2>&1 &&
 +      tr -d '\015' <output |
 +      sort -u |
 +      sed -ne '/^Accept-Language:/ p' >actual &&
 +      test_cmp expect actual
 +}
 +
 +test_expect_success 'git client sends Accept-Language based on LANGUAGE' '
 +      check_language "ko-KR, *;q=0.9" ko_KR.UTF-8'
 +
 +test_expect_success 'git client sends Accept-Language correctly with unordinary LANGUAGE' '
 +      check_language "ko-KR, *;q=0.9" "ko_KR:" &&
 +      check_language "ko-KR, en-US;q=0.9, *;q=0.8" "ko_KR::en_US" &&
 +      check_language "ko-KR, *;q=0.9" ":::ko_KR" &&
 +      check_language "ko-KR, en-US;q=0.9, *;q=0.8" "ko_KR!!:en_US" &&
 +      check_language "ko-KR, ja-JP;q=0.9, *;q=0.8" "ko_KR en_US:ja_JP"'
 +
 +test_expect_success 'git client sends Accept-Language with many preferred languages' '
 +      check_language "ko-KR, en-US;q=0.9, fr-CA;q=0.8, de;q=0.7, sr;q=0.6, \
 +ja;q=0.5, zh;q=0.4, sv;q=0.3, pt;q=0.2, *;q=0.1" \
 +              ko_KR.EUC-KR:en_US.UTF-8:fr_CA:de.UTF-8@euro:sr@latin:ja:zh:sv:pt &&
 +      check_language "ko-KR, en-US;q=0.99, fr-CA;q=0.98, de;q=0.97, sr;q=0.96, \
 +ja;q=0.95, zh;q=0.94, sv;q=0.93, pt;q=0.92, nb;q=0.91, *;q=0.90" \
 +              ko_KR.EUC-KR:en_US.UTF-8:fr_CA:de.UTF-8@euro:sr@latin:ja:zh:sv:pt:nb
 +'
 +
 +test_expect_success 'git client does not send an empty Accept-Language' '
 +      GIT_CURL_VERBOSE=1 LANGUAGE= git ls-remote "$HTTPD_URL/dumb/repo.git" 2>stderr &&
 +      ! grep "^Accept-Language:" stderr
 +'
 +
  stop_httpd
  test_done
index 66439e58fcf4b08a43ef417b054ae476ffbe3aea,7c27edb17d6617e9b02cc7cf8d55102fdc492b3f..2b293119015af7bfb8f151d2a3ec8c51c4c0b209
@@@ -2,12 -2,6 +2,6 @@@
  
  test_description='test smart fetching over http via http-backend'
  . ./test-lib.sh
- if test -n "$NO_CURL"; then
-       skip_all='skipping test, git built without http support'
-       test_done
- fi
  . "$TEST_DIRECTORY"/lib-httpd.sh
  start_httpd
  
@@@ -83,7 -77,7 +77,7 @@@ test_expect_success 'clone http reposit
  test_expect_success 'fetch changes via http' '
        echo content >>file &&
        git commit -a -m two &&
 -      git push public
 +      git push public &&
        (cd clone && git pull) &&
        test_cmp file clone/file
  '
@@@ -169,7 -163,7 +163,7 @@@ test_expect_success 'GIT_SMART_HTTP ca
  '
  
  test_expect_success 'invalid Content-Type rejected' '
 -      test_must_fail git clone $HTTPD_URL/broken_smart/repo.git 2>actual
 +      test_must_fail git clone $HTTPD_URL/broken_smart/repo.git 2>actual &&
        grep "not valid:" actual
  '
  
@@@ -209,25 -203,16 +203,25 @@@ test_expect_success 'cookies stored in 
        git config http.cookiefile cookies.txt &&
        git config http.savecookies true &&
        git ls-remote $HTTPD_URL/smart_cookies/repo.git master &&
 -      tail -3 cookies.txt > cookies_tail.txt
 +      tail -3 cookies.txt >cookies_tail.txt &&
        test_cmp expect_cookies.txt cookies_tail.txt
  '
  
 -test -n "$GIT_TEST_LONG" && test_set_prereq EXPENSIVE
 +test_expect_success 'transfer.hiderefs works over smart-http' '
 +      test_commit hidden &&
 +      test_commit visible &&
 +      git push public HEAD^:refs/heads/a HEAD:refs/heads/b &&
 +      git --git-dir="$HTTPD_DOCUMENT_ROOT_PATH/repo.git" \
 +              config transfer.hiderefs refs/heads/a &&
 +      git clone --bare "$HTTPD_URL/smart/repo.git" hidden.git &&
 +      test_must_fail git -C hidden.git rev-parse --verify a &&
 +      git -C hidden.git rev-parse --verify b
 +'
  
 -test_expect_success EXPENSIVE 'create 50,000 tags in the repo' '
 +test_expect_success 'create 2,000 tags in the repo' '
        (
        cd "$HTTPD_DOCUMENT_ROOT_PATH/repo.git" &&
 -      for i in `test_seq 50000`
 +      for i in $(test_seq 2000)
        do
                echo "commit refs/heads/too-many-refs"
                echo "mark :$i"
        )
  '
  
 -test_expect_success EXPENSIVE 'clone the 50,000 tag repo to check OS command line overflow' '
 -      git clone $HTTPD_URL/smart/repo.git too-many-refs 2>err &&
 -      test_line_count = 0 err &&
 +test_expect_success CMDLINE_LIMIT \
 +      'clone the 2,000 tag repo to check OS command line overflow' '
 +      run_with_limited_cmdline git clone $HTTPD_URL/smart/repo.git too-many-refs &&
        (
                cd too-many-refs &&
 -              test $(git for-each-ref refs/tags | wc -l) = 50000
 +              git for-each-ref refs/tags >actual &&
 +              test_line_count = 2000 actual
        )
  '
  
 +test_expect_success 'large fetch-pack requests can be split across POSTs' '
 +      GIT_CURL_VERBOSE=1 git -c http.postbuffer=65536 \
 +              clone --bare "$HTTPD_URL/smart/repo.git" split.git 2>err &&
 +      grep "^> POST" err >posts &&
 +      test_line_count = 2 posts
 +'
 +
  stop_httpd
  test_done