Sync command should throw error for dirty repositories