Refactor -git_arrayWithStrarray: to work with all array types

For merging into #277.

@tiennou Sometimes it's just easier to explain with code. :stars: