File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ test_description='Tests replace refs functionality'
7
7
exec < /dev/null
8
8
9
9
. ./test-lib.sh
10
+ . " $TEST_DIRECTORY /lib-gpg.sh"
10
11
11
12
add_and_commit_file ()
12
13
{
@@ -394,4 +395,27 @@ test_expect_success '--graft with and without already replaced object' '
394
395
git replace -d $HASH5
395
396
'
396
397
398
+ test_expect_success GPG ' set up a signed commit' '
399
+ echo "line 17" >>hello &&
400
+ echo "line 18" >>hello &&
401
+ git add hello &&
402
+ test_tick &&
403
+ git commit --quiet -S -m "hello: 2 more lines in a signed commit" &&
404
+ HASH8=$(git rev-parse --verify HEAD) &&
405
+ git verify-commit $HASH8
406
+ '
407
+
408
+ test_expect_success GPG ' --graft with a signed commit' '
409
+ git cat-file commit $HASH8 >orig &&
410
+ git replace --graft $HASH8 &&
411
+ git cat-file commit $HASH8 >repl &&
412
+ commit_has_parents $HASH8 &&
413
+ test_must_fail git verify-commit $HASH8 &&
414
+ sed -n -e "/^tree /p" -e "/^author /p" -e "/^committer /p" orig >expected &&
415
+ echo >>expected &&
416
+ sed -e "/^$/q" repl >actual &&
417
+ test_cmp expected actual &&
418
+ git replace -d $HASH8
419
+ '
420
+
397
421
test_done
You can’t perform that action at this time.
0 commit comments