@@ -189,8 +189,12 @@ test_expect_success 'no advice given for explicit detached head state' '
189
189
# Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS (new format)
190
190
test_expect_success ' describe_detached_head prints no SHA-1 ellipsis when not asked to' "
191
191
192
+ commit=$( git rev-parse --short=12 master^) &&
193
+ commit2=$( git rev-parse --short=12 master~2) &&
194
+ commit3=$( git rev-parse --short=12 master~3) &&
195
+
192
196
# The first detach operation is more chatty than the following ones.
193
- cat >1st_detach <<-' EOF' &&
197
+ cat >1st_detach <<-EOF &&
194
198
Note: checking out 'HEAD^'.
195
199
196
200
You are in 'detached HEAD' state. You can look around, make experimental
@@ -202,18 +206,18 @@ test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not as
202
206
203
207
git checkout -b <new-branch-name>
204
208
205
- HEAD is now at 7c7cd714e262 three
209
+ HEAD is now at \$ commit three
206
210
EOF
207
211
208
212
# The remaining ones just show info about previous and current HEADs.
209
- cat >2nd_detach <<-' EOF' &&
210
- Previous HEAD position was 7c7cd714e262 three
211
- HEAD is now at 139b20d8e6c5 two
213
+ cat >2nd_detach <<-EOF &&
214
+ Previous HEAD position was \$ commit three
215
+ HEAD is now at \$ commit2 two
212
216
EOF
213
217
214
- cat >3rd_detach <<-' EOF' &&
215
- Previous HEAD position was 139b20d8e6c5 two
216
- HEAD is now at d79ce1670bdc one
218
+ cat >3rd_detach <<-EOF &&
219
+ Previous HEAD position was \$ commit2 two
220
+ HEAD is now at \$ commit3 one
217
221
EOF
218
222
219
223
reset &&
@@ -261,8 +265,12 @@ test_expect_success 'describe_detached_head prints no SHA-1 ellipsis when not as
261
265
# Detached HEAD tests for GIT_PRINT_SHA1_ELLIPSIS (old format)
262
266
test_expect_success ' describe_detached_head does print SHA-1 ellipsis when asked to' "
263
267
268
+ commit=$( git rev-parse --short=12 master^) &&
269
+ commit2=$( git rev-parse --short=12 master~2) &&
270
+ commit3=$( git rev-parse --short=12 master~3) &&
271
+
264
272
# The first detach operation is more chatty than the following ones.
265
- cat >1st_detach <<-' EOF' &&
273
+ cat >1st_detach <<-EOF &&
266
274
Note: checking out 'HEAD^'.
267
275
268
276
You are in 'detached HEAD' state. You can look around, make experimental
@@ -274,18 +282,18 @@ test_expect_success 'describe_detached_head does print SHA-1 ellipsis when asked
274
282
275
283
git checkout -b <new-branch-name>
276
284
277
- HEAD is now at 7c7cd714e262 ... three
285
+ HEAD is now at \$ commit ... three
278
286
EOF
279
287
280
288
# The remaining ones just show info about previous and current HEADs.
281
- cat >2nd_detach <<-' EOF' &&
282
- Previous HEAD position was 7c7cd714e262 ... three
283
- HEAD is now at 139b20d8e6c5 ... two
289
+ cat >2nd_detach <<-EOF &&
290
+ Previous HEAD position was \$ commit ... three
291
+ HEAD is now at \$ commit2 ... two
284
292
EOF
285
293
286
- cat >3rd_detach <<-' EOF' &&
287
- Previous HEAD position was 139b20d8e6c5 ... two
288
- HEAD is now at d79ce1670bdc ... one
294
+ cat >3rd_detach <<-EOF &&
295
+ Previous HEAD position was \$ commit2 ... two
296
+ HEAD is now at \$ commit3 ... one
289
297
EOF
290
298
291
299
reset &&
0 commit comments