litex_setup: Fix git checkout to specific version (we are using short sha1 hashes).

This commit is contained in:
Florent Kermarrec 2021-10-18 08:19:11 +02:00
parent 57002cf3fc
commit f92a185109
1 changed files with 2 additions and 2 deletions

View File

@ -136,7 +136,7 @@ if "init" in sys.argv[1:]:
subprocess.check_call("git clone " + full_url + " " + opts, shell=True)
if sha1 is not None:
os.chdir(os.path.join(current_path, name))
os.system("git checkout {:040x}".format(sha1))
os.system("git checkout {:07x}".format(sha1))
# Repositories update
if "update" in sys.argv[1:]:
@ -155,7 +155,7 @@ if "update" in sys.argv[1:]:
subprocess.check_call("git submodule update --init --recursive", shell=True)
if sha1 is not None:
os.chdir(os.path.join(current_path, name))
os.system("git checkout {:040x}".format(sha1))
os.system("git checkout {:07x}".format(sha1))
# Repositories installation
if "install" in sys.argv[1:]: