Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-07-03 02:28:22 +0400
committerJunio C Hamano <gitster@pobox.com>2008-07-03 02:28:22 +0400
commit8ee4a6c2ec6738cfbc815dc59e44825f2a9b9f15 (patch)
tree16528347bad184d2439fa0e9b6fc559e9bf53b95 /t/t4128-apply-root.sh
parentc4730f35cc6507bc117a08885d88668fe02b1a7d (diff)
apply --root: thinkofix.
The end of a string is string[length-1], not string[length+1]. I pointed it out during the review, but I forgot about it when applying the patch. This should fix it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4128-apply-root.sh')
-rwxr-xr-xt/t4128-apply-root.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/t/t4128-apply-root.sh b/t/t4128-apply-root.sh
index 80b5af2b41..b650245455 100755
--- a/t/t4128-apply-root.sh
+++ b/t/t4128-apply-root.sh
@@ -8,7 +8,9 @@ test_expect_success 'setup' '
mkdir -p some/sub/dir &&
echo Hello > some/sub/dir/file &&
- git add some/sub/dir/file
+ git add some/sub/dir/file &&
+ git commit -m initial &&
+ git tag initial
'
@@ -21,7 +23,7 @@ diff a/bla/blub/dir/file b/bla/blub/dir/file
+Bello
EOF
-test_expect_success 'apply --root -p --index' '
+test_expect_success 'apply --root -p (1)' '
git apply --root=some/sub -p3 --index patch &&
test Bello = $(git show :some/sub/dir/file) &&
@@ -29,4 +31,13 @@ test_expect_success 'apply --root -p --index' '
'
+test_expect_success 'apply --root -p (2) ' '
+
+ git reset --hard initial &&
+ git apply --root=some/sub/ -p3 --index patch &&
+ test Bello = $(git show :some/sub/dir/file) &&
+ test Bello = $(cat some/sub/dir/file)
+
+'
+
test_done