]> granicus.if.org Git - esp-idf/commitdiff
idf_tools.py: pass --work-tree instead of -C option to git
authorX-Ryl669 <boite.pour.spam@gmail.com>
Wed, 4 Sep 2019 21:36:47 +0000 (23:36 +0200)
committerIvan Grokhotkov <ivan@espressif.com>
Tue, 24 Sep 2019 04:00:31 +0000 (06:00 +0200)
Older versions of git do not support -C option. Use --work-tree option
instead.

Closes https://github.com/espressif/esp-idf/issues/4018
Merges https://github.com/espressif/esp-idf/pull/4019

tools/idf_tools.py

index 3d2341237192981a84c5dc445bbec2fdf6e45fcb..ef292cf77b73c096ef21258274bc56a2af63f00b 100755 (executable)
@@ -810,7 +810,7 @@ def get_python_env_path():
         with open(version_file_path, "r") as version_file:
             idf_version_str = version_file.read()
     else:
-        idf_version_str = subprocess.check_output(['git', '-C', global_idf_path, 'describe', '--tags'], cwd=global_idf_path, env=os.environ).decode()
+        idf_version_str = subprocess.check_output(['git', '--work-tree=' + global_idf_path, 'describe', '--tags'], cwd=global_idf_path, env=os.environ).decode()
     match = re.match(r'^v([0-9]+\.[0-9]+).*', idf_version_str)
     idf_version = match.group(1)