Update JGit version, fix formatting. Improve checkout refs