Fix "--pretty=format:" for parent related items.

There are two breakages in the %P/%p interpolation.  It appended
an excess SP at the end of the list, and it gave uninitialized
contents of a buffer on the stack for root commits.

This fixes it, while updating the t6006 test which expected the
wrong output.

Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Junio C Hamano
2007-03-28 13:33:37 -07:00
parent 9c880b3ea5
commit 542e165cdc
2 changed files with 12 additions and 8 deletions

8
t/t6006-rev-list-format.sh Normal file → Executable file
View File

@ -39,11 +39,11 @@ EOF
test_format parents %P%n%p <<'EOF'
commit 131a310eb913d107dd3c09a65d1651175898735d
86c75cfd708a0e5868dc876ed5b8bb66c80b4873
86c75cf
86c75cfd708a0e5868dc876ed5b8bb66c80b4873
86c75cf
commit 86c75cfd708a0e5868dc876ed5b8bb66c80b4873
86c75cf
86c75cf
EOF
# we don't test relative here