@matheusbsbs / matheus-bagliano / commits / 57c7d9a775
Fork 0

Trivial path optimization test

Linus: get_pathspec() does turn '.' into an empty string (which is correct - git internally does _not_ ever understand the notion of "." as the current working directory), but it doesn't ever do the optimization of noticing that a pathspec that consists solely of an empty string is "equivalent" to an empty pathspec. The test is to ensure that this behaviour stays. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>

Alex Riesen committed Jul 25, 2006 at 01:23 UTC 57c7d9a7756f9c0165d0aa003eb8a05c08cd9fae
1 file changed +19
t/t6004-rev-list-path-optim.sh new
+19
@@ -0,0 +1,19 @@
1 +#!/bin/sh
2 +
3 +test_description='git-rev-list trivial path optimization test'
4 +
5 +. ./test-lib.sh
6 +
7 +test_expect_success setup '
8 +echo Hello > a &&
9 +git add a &&
10 +git commit -m "Initial commit" a
11 +'
12 +
13 +test_expect_success path-optimization '
14 + commit=$(echo "Unchanged tree" | git-commit-tree "HEAD^{tree}" -p HEAD) &&
15 + test $(git-rev-list $commit | wc -l) = 2 &&
16 + test $(git-rev-list $commit -- . | wc -l) = 1
17 +'
18 +
19 +test_done