|
40 | 40 | GetBinGitHash, |
41 | 41 | ) |
42 | 42 | from mytonctrl.migrate import run_migrations |
43 | | -from mytonctrl.utils import GetItemFromList, timestamp2utcdatetime |
| 43 | +from mytonctrl.utils import GetItemFromList, timestamp2utcdatetime, fix_git_config |
44 | 44 |
|
45 | 45 | import sys, getopt, os |
46 | 46 |
|
@@ -290,21 +290,6 @@ def check_vport(local, ton): |
290 | 290 | #end define |
291 | 291 |
|
292 | 292 |
|
293 | | -def fix_git_config(git_path: str): |
294 | | - args = ["git", "status"] |
295 | | - try: |
296 | | - process = subprocess.run(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, cwd=git_path, timeout=3) |
297 | | - err = process.stderr.decode("utf-8") |
298 | | - except Exception as e: |
299 | | - err = str(e) |
300 | | - if err: |
301 | | - if 'git config --global --add safe.directory' in err: |
302 | | - args = ["git", "config", "--global", "--add", "safe.directory", git_path] |
303 | | - subprocess.run(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=3) |
304 | | - else: |
305 | | - raise Exception(f'Failed to check git status: {err}') |
306 | | -#end define |
307 | | - |
308 | 293 | def check_git(input_args, default_repo, text): |
309 | 294 | src_dir = "/usr/src" |
310 | 295 | git_path = f"{src_dir}/{default_repo}" |
@@ -708,6 +693,8 @@ def PrintLocalStatus(local, adnlAddr, validatorIndex, validatorEfficiency, valid |
708 | 693 | validatorBinGitPath = "/usr/bin/ton/validator-engine/validator-engine" |
709 | 694 | mtcGitHash = get_git_hash(mtcGitPath, short=True) |
710 | 695 | validatorGitHash = GetBinGitHash(validatorBinGitPath, short=True) |
| 696 | + fix_git_config(mtcGitPath) |
| 697 | + fix_git_config(validatorGitPath) |
711 | 698 | mtcGitBranch = get_git_branch(mtcGitPath) |
712 | 699 | validatorGitBranch = get_git_branch(validatorGitPath) |
713 | 700 | mtcGitHash_text = bcolors.yellow_text(mtcGitHash) |
|
0 commit comments