]> git.ipfire.org Git - thirdparty/git.git/commit
t/lib-commit-graph.sh: allow `graph_read_expect()` in sub-directories
authorTaylor Blau <me@ttaylorr.com>
Mon, 24 Jul 2023 16:39:22 +0000 (12:39 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 24 Jul 2023 21:35:21 +0000 (14:35 -0700)
commitc355b641769db757bc4187aa03f18510a289c86d
treebab6ab05965468043794c0e8860cbc1bc276b13d
parent6016ee0a7130d3ad656def12d724d1525d39af9b
t/lib-commit-graph.sh: allow `graph_read_expect()` in sub-directories

The `graph_read_expect()` function is used to ensure that the output of
the "read-graph" test helper matches certain parameters (e.g., how many
commits are in the graph, which chunks were written, etc.).

It expects the Git repository being tested to be at the current working
directory. However, a handful of t5318 tests use different repositories
stored in sub-directories. To work around this, several tests in t5318
change into the relevant repository outside of a sub-shell, altering the
context for the rest of the suite.

Prepare to remove these globally-scoped directory changes by teaching
`graph_read_expect()` to take an optional "-C dir" to specify where the
repository containing the commit-graph being tested is.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/lib-commit-graph.sh