Split git prompt into function