File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ test_description='Tests replace refs functionality'
77exec < /dev/null
88
99. ./test-lib.sh
10+ . " $TEST_DIRECTORY /lib-gpg.sh"
1011
1112add_and_commit_file ()
1213{
@@ -394,4 +395,27 @@ test_expect_success '--graft with and without already replaced object' '
394395 git replace -d $HASH5
395396'
396397
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+
397421test_done
You can’t perform that action at this time.
0 commit comments