Re: [PATCH v2 07/14] commit-graph: implement git-commit-graph --update-head
- From
SZEDER Gábor <szeder.dev@gmail.com>
- Date
- Feb 2, 2018, 02:45 UTC
- Message-ID
- <20180202024548.2663-1-szeder.dev@gmail.com>
- In-Reply-To
- <1517348383-112294-8-git-send-email-dstolee@microsoft.com>
> diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh > index da565624e3..d1a23bcdaf 100755 > --- a/t/t5318-commit-graph.sh > +++ b/t/t5318-commit-graph.sh
Show 5 quoted lines
> @@ -107,6 +112,9 @@ test_expect_success 'setup bare repo' \
> test_expect_success 'write graph in bare repo' \
> 'graphbare=$(git commit-graph --write) &&
> test_path_is_file ${baredir}/graph-${graphbare}.graph &&
> + test_path_is_file ${baredir}/graph-head &&This test and the one preceeding it are wrong.
Note that 'git commit-graph --write' above is missing the '--update-head' option, so there should be no graph-head file written, yet this 'this test_path_is_file' doesn't fail the test.
The devil lies in the previous test 'setup bare repo', where this bare repo is created by cloning from a local remote: a simple 'git clone --bare full bare' hardlinks all files under .git/objects, including all graph and graph-head files that exist in the remote repo.
The previous test should run 'git clone --bare --no-local full bare' instead, and then this test would fail because of the missing graph-head file, as it should. Specifying '--update-head' will make it work again.
Show 5 quoted lines
> + echo ${graphbare} >expect &&
> + cmp -n 40 expect ${baredir}/graph-head &&
> git commit-graph --read --graph-hash=${graphbare} >output &&
> _graph_read_expect "18" "${baredir}" &&
> cmp expect output'