Added more git support, notably handling for empty directories