Skip to contentSkip to conversation

fetch: Add GIT_CONFIG_GLOBAL to FETCH_EXPORT_VARS

PATCH New Florian Schmaus 1 participant 1 message Feb 27

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fetch: Add GIT_CONFIG_GLOBAL to FETCH_EXPORT_VARS

Many CI setups rely on the GIT_CONFIG_GLOBAL environment variable to define project-specific gitconfigs, often to inject credentials using git's url.<base>.insteadOf configuration.

However, BitBake restricts the environment variables passed to the fetch task to a fixed list (FETCH_EXPORT_VARS). Because GIT_CONFIG_GLOBAL is missing from this default list, the variable is stripped from the environment.

Add GIT_CONFIG_GLOBAL to FETCH_EXPORT_VARS to natively support this credential injection method (and GIT_CONFIG_GLOBAL in general). This also eliminates confusion for users who expect the variable to propagate after adding it to BB_ENV_PASSTHROUGH_ADDITIONS, only to find it has no effect during the fetch task.

---
 lib/bb/fetch2/__init__.py | 1 +
 1 file changed, 1 insertion(+)
lib/bb/fetch2/__init__.py +1 -0
index dcf7adc26abe..aaefd860204a 100644
@@ -877,6 +877,7 @@ FETCH_EXPORT_VARS = ['HOME', 'PATH',
                      'FTPS_PROXY', 'ftps_proxy',
                      'NO_PROXY', 'no_proxy',
                      'ALL_PROXY', 'all_proxy',
+                     'GIT_CONFIG_GLOBAL',
                      'GIT_PROXY_COMMAND',
                      'GIT_SSH',
                      'GIT_SSH_COMMAND',
Signature · 1 line
2.52.0