run(f'"{git}" -C "{dir}" fetch',f"Fetching updates for {name}...",f"Couldn't fetch {name}")
run_git('fetch',f"Fetching updates for {name}...",f"Couldn't fetch {name}")
try:
run(f'"{git}" -C "{dir}" checkout {commithash}',f"Checking out commit for {name} with hash: {commithash}...",f"Couldn't checkout commit {commithash} for {name}",live=True)
exceptRuntimeError:
print(f"Unable to checkout {name} with hash {commithash}, attempting autofix...")
git_fix_workspace(dir,name)
run(f'"{git}" -C "{dir}" checkout {commithash}',f"Checking out commit for {name} with hash: {commithash}...",f"Couldn't checkout commit {commithash} for {name}",live=True)
run_git('checkout',f"Checking out commit for {name} with hash: {commithash}...",f"Couldn't checkout commit {commithash} for {name}",live=True)