git-update: Fix and restructure logic