Skip to content

Commit

Permalink
soc/cores/cpu/naxriscv/core: force go back previous directory after g…
Browse files Browse the repository at this point in the history
…it clone
  • Loading branch information
trabucayre committed Jan 18, 2024
1 parent 4222a58 commit f00d492
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions litex/soc/cores/cpu/naxriscv/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,12 @@ def git_setup(name, dir, repo, branch, hash):
), shell=True)
# Use specific SHA1 (Optional).
print(f"Updating {name} Git repository...")
cwd = os.getcwd()
os.chdir(os.path.join(dir))
wipe_cmd = "&& git clean --force -d -x && git reset --hard" if "wipe" in NaxRiscv.update_repo else ""
checkout_cmd = f"&& git checkout {hash}" if hash is not None else ""
subprocess.check_call(f"cd {dir} {wipe_cmd} && git checkout {branch} && git submodule init && git pull --recurse-submodules {checkout_cmd}", shell=True)
os.chdir(cwd)

# Netlist Generation.
@staticmethod
Expand Down

0 comments on commit f00d492

Please sign in to comment.