Properly update repository after build finishes, with canceled job