git: git_hash/git_hash_ref now takes and returns a string
git: git_hash/git_hash_ref now takes and returns a string

This simplifies the code and reduces the amount of calls to heap
allocation functions.

Change-Id: I7677e74d617aa682edf1a4003ee827729f5c3f91
Reviewed-by: Scott Parlane <85029adc3fa41ef14594a57826619713bfe95f25@alliedtelesis.co.nz>
Reviewed-by: Ridge Kennedy <c60c433c4c1ae237d133641099200771ff6f6f30@alliedtelesis.co.nz>
Signed-off-by: Matt Bennett <e3d8681cec70d3da741935b3385821001b249adc@alliedtelesis.co.nz>

ATL-NZ/buildsyspp,alliedtelesis/buildsyspp