aboutsummaryrefslogtreecommitdiff
path: root/t/t6004-rev-list-path-optim.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t6004-rev-list-path-optim.sh')
-rwxr-xr-xt/t6004-rev-list-path-optim.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t6004-rev-list-path-optim.sh b/t/t6004-rev-list-path-optim.sh
new file mode 100755
index 000000000..5182dbb15
--- /dev/null
+++ b/t/t6004-rev-list-path-optim.sh
@@ -0,0 +1,19 @@
+#!/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