Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
git-rfc3161
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CSG
git-rfc3161
Commits
aae1f6ac
Commit
aae1f6ac
authored
Oct 22, 2010
by
Junio C Hamano
Browse files
Options
Downloads
Patches
Plain Diff
test: git-apply -p2 rename/chmod only
Signed-off-by:
Junio C Hamano
<
gitster@pobox.com
>
parent
cefd43b7
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
t/t4120-apply-popt.sh
+26
-0
26 additions, 0 deletions
t/t4120-apply-popt.sh
with
26 additions
and
0 deletions
t/t4120-apply-popt.sh
+
26
−
0
View file @
aae1f6ac
...
@@ -56,4 +56,30 @@ test_expect_success 'apply with too large -p and fancy filename' '
...
@@ -56,4 +56,30 @@ test_expect_success 'apply with too large -p and fancy filename' '
grep "removing 3 leading" err
grep "removing 3 leading" err
'
'
test_expect_success
'apply (-p2) diff, mode change only'
'
cat >patch.chmod <<-\EOF &&
diff --git a/sub/file1 b/sub/file1
old mode 100644
new mode 100755
EOF
chmod 644 file1 &&
git apply -p2 patch.chmod &&
test -x file1
'
test_expect_success
'apply (-p2) diff, rename'
'
cat >patch.rename <<-\EOF &&
diff --git a/sub/file1 b/sub/file2
similarity index 100%
rename from sub/file1
rename to sub/file2
EOF
echo A >expected &&
cp file1.saved file1 &&
rm -f file2 &&
git apply -p2 patch.rename &&
test_cmp expected file2
'
test_done
test_done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment