Patch from Joachim Reichel <reichel@debian.org>, adapted from the flat layout to the Git layout. Fix #1048.