Subject: Re: [RFC PATCH 0/2] alternate hash test

From: SZEDER Gábor <[email-masked]>
Date: Sun, 28 Jan 2018 19:32:39 +0100

> This series wires up an alternate hash implementation, namely
> BLAKE2b-160.  The goal is to allow us to identify tests which rely on
> the hash algorithm in use so that we can fix those tests.

> t9903-bash-prompt.sh                             (Wstat: 256 Tests: 66 Failed: 53)
>   Failed tests:  4, 6-10, 14-34, 36, 39-62, 65
>   Non-zero exit status: 1

I didn't recall seeing hardcoded SHA-1s in the bash prompt tests, so
went to have a look.  And indeed, these failures are not the test's
fault, but the result of a segfault in 'git checkout' while trying to
return from an orphan branch in test 4.  The rest of the failures are
mostly fallout caused by the wrong branch being checked out or the
leftover index.lock.

$ ./t9903-bash-prompt.sh -v -i
<...>
expecting success: 
      printf " (unborn)" >expected &&
      git checkout --orphan unborn &&
      test_when_finished "git checkout master" &&
      __git_ps1 >"$actual" &&
      test_cmp expected "$actual"

Switched to a new branch 'unborn'
./test-lib.sh: line 609: 29342 Segmentation fault      git checkout master
not ok 4 - prompt - unborn branch

$ gdb --args ../../git checkout master
<...>
Program received signal SIGSEGV, Segmentation fault.
0x000000000041b636 in merge_working_tree (opts=0x7fffffffd200, 
    old=0x7fffffffd0d0, new=0x7fffffffd1e0,
writeout_error=0x7fffffffd0c0)
    at builtin/checkout.c:525
525                     init_tree_desc(&trees[0], tree->buffer,
tree->size);
(gdb) p tree 
$1 = (struct tree *) 0x0

The root cause is that patch 2/2 misses places where EMPTY_TREE_SHA1_*
constants should have been replaced with their EMPTY_TREE_SBLAKE2B_*
counterparts.