[PATCH 1/5] t0108: Avoid unnecessary fork()

Lukas Fleischer cgit at cryptocrack.de
Mon Aug 26 20:38:31 CEST 2013


Use `git rev-list --max-parents=0 HEAD` instead of `git rev-list HEAD |
tail -1` to get the root commit. This works since Git 1.7.4.2.

Signed-off-by: Lukas Fleischer <cgit at cryptocrack.de>
---
 tests/t0108-patch.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/t0108-patch.sh b/tests/t0108-patch.sh
index 3b5bae4..867d739 100755
--- a/tests/t0108-patch.sh
+++ b/tests/t0108-patch.sh
@@ -24,7 +24,7 @@ test_expect_success 'find `cgit` signature' '
 '
 
 test_expect_success 'find initial commit' '
-	root=$(git --git-dir="$PWD/repos/foo/.git" rev-list HEAD | tail -1)
+	root=$(git --git-dir="$PWD/repos/foo/.git" rev-list --max-parents=0 HEAD)
 '
 
 test_expect_success 'generate patch for initial commit' '
-- 
1.8.4.rc3.500.gc3113b0



More information about the CGit mailing list