Nguyễn Thái Ngọc Duy  <pclo...@gmail.com> writes:

> t7814 has repo tree like this
>
>   initial-repo
>     submodule
>       sub
>
> In each repo 'submodule' and 'sub', a commit is made to add the same
> initial file 'a' with the same message 'add a'. If tests run fast
> enough, the two commits are made in the same second, resulting
> identical commits.
>
> There is nothing wrong with that per-se. But it could make the test
> flaky. Currently all submodule odbs are merged back in the main
> one (because we can't, or couldn't, access separate submodule repos
> otherwise). But eventually we need to access objects from the right
> repo.
>
> Because the same commit could sometimes be present in both 'submodule'
> and 'sub', if there is a bug looking up objects in the wrong repo,
> sometimes it will go unnoticed because it finds the needed object in the
> wrong repo anyway.
>
> Fix this by changing commit time after every commit. This makes all
> commits unique. Of course there are still identical blobs in different
> repos, but because we often lookup commit first, then tree and blob,
> unique commits are already quite safe.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com>
> ---
>  > And I can't quite understand how t7814 sometimes passed.
>
>  I do now. This patch makes it fail consistently for me.

Well analysed.  Very well done.  Thanks.

Reply via email to