Merge branch 'jt/unparse-commit-upon-graft-change'

Updating the graft information invalidates the list of parents of
in-core commit objects that used to be in the graft file.

* jt/unparse-commit-upon-graft-change:
  commit,shallow: unparse commits if grafts changed
This commit is contained in:
Junio C Hamano
2022-06-13 15:53:42 -07:00
3 changed files with 34 additions and 1 deletions

View File

@ -164,12 +164,24 @@ test_expect_success 'fetch --update-shallow' '
test_expect_success 'fetch --update-shallow into a repo with submodules' '
git init a-submodule &&
test_commit -C a-submodule foo &&
test_when_finished "rm -rf repo-with-sub" &&
git init repo-with-sub &&
git -C repo-with-sub submodule add ../a-submodule a-submodule &&
git -C repo-with-sub commit -m "added submodule" &&
git -C repo-with-sub fetch --update-shallow ../shallow/.git refs/heads/*:refs/remotes/shallow/*
'
test_expect_success 'fetch --update-shallow a commit that is also a shallow point into a repo with submodules' '
test_when_finished "rm -rf repo-with-sub" &&
git init repo-with-sub &&
git -C repo-with-sub submodule add ../a-submodule a-submodule &&
git -C repo-with-sub commit -m "added submodule" &&
SHALLOW=$(cat shallow/.git/shallow) &&
git -C repo-with-sub fetch --update-shallow ../shallow/.git "$SHALLOW":refs/heads/a-shallow
'
test_expect_success 'fetch --update-shallow (with fetch.writeCommitGraph)' '
(
cd shallow &&