+
+ if local_nit.file_exists then local_nit.rmdir
+
+ exec_and_check "git clone {remote_nit} {local_nit}"
+ local_nit.chdir
+ exec_and_check "git config remote.origin.fetch +refs/remotes/origin/pr/*:refs/remotes/origin/pr/*"
+ exec_and_check "git fetch origin --quiet"
+ exec_and_check "git checkout {branch_hash}"
+ exec_and_check "cp {remote_nit}/bin/* bin/"
+ exec_and_check "src/git-gen-version.sh"
+ end
+
+ private fun exec_and_check(cmd: String)
+ do
+ if verbose > 0 then
+ print "+ {cmd}"
+ var res = sys.system(cmd)
+ assert res == 0 else print "Command '{cmd}' failed."
+ end