| # Copyright OpenEmbedded Contributors |
| # SPDX-License-Identifier: MIT |
| # Wrapper around 'git' that doesn't think we are root |
| os.environ['PSEUDO_UNLOAD'] = '1' |
| # calculate path to the real 'git' |
| path = os.environ['PATH'] |
| # we need to remove our path but also any other copy of this script which |
| # may be present, e.g. eSDK. |
| replacements = [os.path.dirname(sys.argv[0])] |
| for p in path.split(":"): |
| if p.endswith("/scripts"): |
| path = path.replace(r, '/ignoreme') |
| real_git = shutil.which('git', path=path) |
| os.execl(real_git, 'git') |
| os.execv(real_git, sys.argv) |