mirror of
https://github.com/git/git
synced 2024-08-27 19:49:21 +00:00
![Alex Riesen](/assets/img/avatar_default.png)
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>
20 lines
417 B
Bash
Executable file
20 lines
417 B
Bash
Executable file
#!/bin/sh
|
|
|
|
test_description='git-rev-list trivial path optimization test'
|
|
|
|
. ./test-lib.sh
|
|
|
|
test_expect_success setup '
|
|
echo Hello > a &&
|
|
git add a &&
|
|
git commit -m "Initial commit" a
|
|
'
|
|
|
|
test_expect_success path-optimization '
|
|
commit=$(echo "Unchanged tree" | git-commit-tree "HEAD^{tree}" -p HEAD) &&
|
|
test $(git-rev-list $commit | wc -l) = 2 &&
|
|
test $(git-rev-list $commit -- . | wc -l) = 1
|
|
'
|
|
|
|
test_done
|