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
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rwxr-xr-xt/t4114-apply-typechange.sh7
-rwxr-xr-xt/t4127-apply-same-fn.sh9
2 files changed, 16 insertions, 0 deletions
diff --git a/t/t4114-apply-typechange.sh b/t/t4114-apply-typechange.sh
index ebadbc347f..da3e64f811 100755
--- a/t/t4114-apply-typechange.sh
+++ b/t/t4114-apply-typechange.sh
@@ -88,6 +88,13 @@ test_expect_success 'symlink becomes file' '
'
test_debug 'cat patch'
+test_expect_success 'symlink becomes file, in reverse' '
+ git checkout -f foo-symlinked-to-bar &&
+ git diff-tree -p HEAD foo-back-to-file > patch &&
+ git checkout foo-back-to-file &&
+ git apply -R --index < patch
+ '
+
test_expect_success 'binary file becomes symlink' '
git checkout -f foo-becomes-binary &&
git diff-tree -p --binary HEAD foo-symlinked-to-bar > patch &&
diff --git a/t/t4127-apply-same-fn.sh b/t/t4127-apply-same-fn.sh
index 972946c174..305b7e649e 100755
--- a/t/t4127-apply-same-fn.sh
+++ b/t/t4127-apply-same-fn.sh
@@ -32,6 +32,10 @@ test_expect_success 'apply same filename with independent changes' '
test_expect_success 'apply same filename with overlapping changes' '
git reset --hard &&
+
+ # Store same_fn so that we can check apply -R in next test
+ cp same_fn same_fn1 &&
+
modify "s/^d/z/" same_fn &&
git diff > patch0 &&
git add same_fn &&
@@ -43,6 +47,11 @@ test_expect_success 'apply same filename with overlapping changes' '
test_cmp same_fn same_fn2
'
+test_expect_success 'apply same filename with overlapping changes, in reverse' '
+ git apply -R patch0 &&
+ test_cmp same_fn same_fn1
+'
+
test_expect_success 'apply same new filename after rename' '
git reset --hard &&
git mv same_fn new_fn &&