Re: [PATCH v5 3/5] t4205 (log-pretty-formats): don't hardcode SHA-1 in expected outputs
Alexey Shumkin <Alex.Crezoff@gmail.com> writes:
Show 22 quoted lines
> The expected SHA-1 digests are always available in variables. Use
> them instead of hardcoding.
>
> Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
> ---
> t/t4205-log-pretty-formats.sh | 48 +++++++++++++++++++++++--------------------
> 1 file changed, 26 insertions(+), 22 deletions(-)
>
> diff --git a/t/t4205-log-pretty-formats.sh b/t/t4205-log-pretty-formats.sh
> index 26fbfde..6d8d457 100755
> --- a/t/t4205-log-pretty-formats.sh
> +++ b/t/t4205-log-pretty-formats.sh
> @@ -101,7 +101,11 @@ test_expect_failure 'NUL termination with --stat' '
>
> test_expect_success 'setup more commits' '
> test_commit "message one" one one message-one &&
> - test_commit "message two" two two message-two
> + test_commit "message two" two two message-two &&
> + head1=$(git rev-list --max-count=1 --abbrev-commit HEAD~0) &&
> + head2=$(git rev-list --max-count=1 --abbrev-commit HEAD~1) &&
> + head3=$(git rev-list --max-count=1 --abbrev-commit HEAD~2) &&
> + head4=$(git rev-list --max-count=1 --abbrev-commit HEAD~3)
Hmmph. Why not rev-parse --short like in your 1/5?