File tree Expand file tree Collapse file tree 5 files changed +45
-11
lines changed
Expand file tree Collapse file tree 5 files changed +45
-11
lines changed Original file line number Diff line number Diff line change @@ -109,7 +109,11 @@ test_expect_success 'CRLF delimiters' '
109109test_expect_success ' quotes' '
110110 restore_checkpoint &&
111111
112- printf "\"file\\101.t\"" | git checkout --pathspec-from-file=- HEAD^1 &&
112+ cat >list <<-\EOF &&
113+ "file\101.t"
114+ EOF
115+
116+ git checkout --pathspec-from-file=list HEAD^1 &&
113117
114118 cat >expect <<-\EOF &&
115119 M fileA.t
@@ -120,7 +124,10 @@ test_expect_success 'quotes' '
120124test_expect_success ' quotes not compatible with --pathspec-file-nul' '
121125 restore_checkpoint &&
122126
123- printf "\"file\\101.t\"" >list &&
127+ cat >list <<-\EOF &&
128+ "file\101.t"
129+ EOF
130+
124131 test_must_fail git checkout --pathspec-from-file=list --pathspec-file-nul HEAD^1
125132'
126133
Original file line number Diff line number Diff line change @@ -109,7 +109,11 @@ test_expect_success 'CRLF delimiters' '
109109test_expect_success ' quotes' '
110110 restore_checkpoint &&
111111
112- printf "\"file\\101.t\"" | git restore --pathspec-from-file=- --source=HEAD^1 &&
112+ cat >list <<-\EOF &&
113+ "file\101.t"
114+ EOF
115+
116+ git restore --pathspec-from-file=list --source=HEAD^1 &&
113117
114118 cat >expect <<-\EOF &&
115119 M fileA.t
@@ -120,7 +124,10 @@ test_expect_success 'quotes' '
120124test_expect_success ' quotes not compatible with --pathspec-file-nul' '
121125 restore_checkpoint &&
122126
123- printf "\"file\\101.t\"" >list &&
127+ cat >list <<-\EOF &&
128+ "file\101.t"
129+ EOF
130+
124131 test_must_fail git restore --pathspec-from-file=list --pathspec-file-nul --source=HEAD^1
125132'
126133
Original file line number Diff line number Diff line change @@ -97,7 +97,11 @@ test_expect_success 'CRLF delimiters' '
9797test_expect_success ' quotes' '
9898 restore_checkpoint &&
9999
100- printf "\"file\\101.t\"" | git add --pathspec-from-file=- &&
100+ cat >list <<-\EOF &&
101+ "file\101.t"
102+ EOF
103+
104+ git add --pathspec-from-file=list &&
101105
102106 cat >expect <<-\EOF &&
103107 A fileA.t
@@ -108,7 +112,10 @@ test_expect_success 'quotes' '
108112test_expect_success ' quotes not compatible with --pathspec-file-nul' '
109113 restore_checkpoint &&
110114
111- printf "\"file\\101.t\"" >list &&
115+ cat >list <<-\EOF &&
116+ "file\101.t"
117+ EOF
118+
112119 test_must_fail git add --pathspec-from-file=list --pathspec-file-nul
113120'
114121
Original file line number Diff line number Diff line change @@ -105,8 +105,12 @@ test_expect_success 'CRLF delimiters' '
105105test_expect_success ' quotes' '
106106 restore_checkpoint &&
107107
108+ cat >list <<-\EOF &&
109+ "file\101.t"
110+ EOF
111+
108112 git rm fileA.t &&
109- printf "\"file\\101.t\"" | git reset --pathspec-from-file=- &&
113+ git reset --pathspec-from-file=list &&
110114
111115 cat >expect <<-\EOF &&
112116 D fileA.t
@@ -117,8 +121,10 @@ test_expect_success 'quotes' '
117121test_expect_success ' quotes not compatible with --pathspec-file-nul' '
118122 restore_checkpoint &&
119123
120- git rm fileA.t &&
121- printf "\"file\\101.t\"" >list &&
124+ cat >list <<-\EOF &&
125+ "file\101.t"
126+ EOF
127+
122128 # Note: "git reset" has not yet learned to fail on wrong pathspecs
123129 git reset --pathspec-from-file=list --pathspec-file-nul &&
124130
Original file line number Diff line number Diff line change @@ -100,7 +100,11 @@ test_expect_success 'CRLF delimiters' '
100100test_expect_success ' quotes' '
101101 restore_checkpoint &&
102102
103- printf "\"file\\101.t\"" | git commit --pathspec-from-file=- -m "Commit" &&
103+ cat >list <<-\EOF &&
104+ "file\101.t"
105+ EOF
106+
107+ git commit --pathspec-from-file=list -m "Commit" &&
104108
105109 cat >expect <<-\EOF &&
106110 A fileA.t
@@ -111,7 +115,10 @@ test_expect_success 'quotes' '
111115test_expect_success ' quotes not compatible with --pathspec-file-nul' '
112116 restore_checkpoint &&
113117
114- printf "\"file\\101.t\"" >list &&
118+ cat >list <<-\EOF &&
119+ "file\101.t"
120+ EOF
121+
115122 test_must_fail git commit --pathspec-from-file=list --pathspec-file-nul -m "Commit"
116123'
117124
You can’t perform that action at this time.
0 commit comments