From 1be36b60f158b55e8d594e2b605928a9a71a432f Mon Sep 17 00:00:00 2001
From: Jeff King <peff@peff.net>
Date: Fri, 1 Jul 2016 03:56:52 -0400
Subject: [PATCH 1/3] Makefile: drop extra dependencies for test helpers

A few test-helpers have Makefile dependencies on specific
object files. But since these files are part of libgit.a
(which all of the helpers link against), the inclusion is
simply redundant.

These were once necessary, but became redundant due to
5c5ba73 (Makefile: Use generic rule to build test programs,
2007-05-31), which added the $(GITLIBS) dependency (but
didn't prune the extra dependency lines). Later commits then
cargo-culted the practice (e.g., b4285c7).

Note that we _do_ need to leave the dependencies on the svn
library, as that is not part of the usual link command.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Makefile | 8 --------
 1 file changed, 8 deletions(-)

diff --git a/Makefile b/Makefile
index 69d32bfe31e..7c7142531a0 100644
--- a/Makefile
+++ b/Makefile
@@ -2231,16 +2231,8 @@ perf: all
 
 .PHONY: test perf
 
-t/helper/test-ctype$X: ctype.o
-
-t/helper/test-date$X: date.o ctype.o
-
-t/helper/test-delta$X: diff-delta.o patch-delta.o
-
 t/helper/test-line-buffer$X: vcs-svn/lib.a
 
-t/helper/test-parse-options$X: parse-options.o parse-options-cb.o
-
 t/helper/test-svn-fe$X: vcs-svn/lib.a
 
 .PRECIOUS: $(TEST_OBJS)

From 4df7c8a0375803b952bad31ac29578cfd56a2ac1 Mon Sep 17 00:00:00 2001
From: Jeff King <peff@peff.net>
Date: Fri, 1 Jul 2016 03:59:44 -0400
Subject: [PATCH 2/3] Makefile: use VCSSVN_LIB to refer to svn library

We have an abstracted variable; let's use it consistently.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 7c7142531a0..cc90c62bcd1 100644
--- a/Makefile
+++ b/Makefile
@@ -2231,9 +2231,9 @@ perf: all
 
 .PHONY: test perf
 
-t/helper/test-line-buffer$X: vcs-svn/lib.a
+t/helper/test-line-buffer$X: $(VCSSVN_LIB)
 
-t/helper/test-svn-fe$X: vcs-svn/lib.a
+t/helper/test-svn-fe$X: $(VCSSVN_LIB)
 
 .PRECIOUS: $(TEST_OBJS)
 

From 503e22418082d1ec616ec98ab90c6a73cd3ef96f Mon Sep 17 00:00:00 2001
From: Johannes Schindelin <johannes.schindelin@gmx.de>
Date: Mon, 11 Jul 2016 13:45:08 +0200
Subject: [PATCH 3/3] t/test-lib.sh: fix running tests with --valgrind
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

We forgot to adjust this code path after moving the test helpers to
t/helper/.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 t/test-lib.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index cd0ecd444de..0c966f3eaa0 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -785,7 +785,7 @@ then
 	# override all git executables in TEST_DIRECTORY/..
 	GIT_VALGRIND=$TEST_DIRECTORY/valgrind
 	mkdir -p "$GIT_VALGRIND"/bin
-	for file in $GIT_BUILD_DIR/git* $GIT_BUILD_DIR/test-*
+	for file in $GIT_BUILD_DIR/git* $GIT_BUILD_DIR/t/helper/test-*
 	do
 		make_valgrind_symlink $file
 	done