Commit 1469b50f authored by Samuel Sirois's avatar Samuel Sirois
Browse files

Force default language when executing git binary

parent bbe7b6a5
Pipeline #10266 passed with stages
in 1 minute and 2 seconds
......@@ -13,6 +13,9 @@ import helpers as h
from .environments import e
GIT_BINARY = 'LC_ALL=C git'
@task(alias='is_dirty')
def check_status():
"""
......@@ -57,7 +60,7 @@ def _check_repo(repoLocalPath):
print green('---')
print green('Verify repo in ' + repoLocalPath)
remoteName = local('LC_ALL=C git remote', capture=True)
remoteName = local('%s remote' % GIT_BINARY, capture=True)
filesStatusRawInfo = _get_files_status_information()
print green('Verify local files status against current HEAD commit...')
......@@ -109,7 +112,7 @@ def _check_local_branches_exist_on_remote(localBranchesRawInfo, remoteName):
if (nbWarnings > 0):
if (confirm(red('There are many local branches not present on remote. Do you want to sync theses?'), default=False)):
for branchName in pushableBranches:
local('git push --set-upstream ' + remoteName + ' ' + branchName)
local('%s push --set-upstream %s %s' % (GIT_BINARY, remoteName, branchName))
# Do not alert with diff as local branches are now pushed
nbWarnings = 0
......@@ -132,7 +135,7 @@ def _check_local_branches_status_vs_remote(localBranchesRawInfo, remoteName):
if (nbWarnings > 0):
if (confirm(red('There are many local branches which are ahead of remote branch. Do you want to sync theses?'), default=False)):
for branchName in pushableBranches:
local('git push ' + remoteName + ' ' + branchName)
local('%s push %s %s' % (GIT_BINARY, remoteName, branchName))
# Do not alert with diff as local branches are now pushed
nbWarnings = 0
......@@ -144,7 +147,7 @@ def _check_local_branches_status_vs_remote(localBranchesRawInfo, remoteName):
def _get_local_branches_information():
return local('git branch --list -vv', capture=True).splitlines()
return local('%s branch --list -vv' % GIT_BINARY, capture=True).splitlines()
def _get_branch_name(branchRawData):
......@@ -161,8 +164,8 @@ def _is_branch_detached(branchName):
def _remote_branch_exists(branchName):
return (len(local('git branch --list --remote "*' + branchName + '"', capture=True).splitlines()) > 0)
return (len(local('%s branch --list --remote "*%s"' % (GIT_BINARY, branchName), capture=True).splitlines()) > 0)
def _get_files_status_information():
return local('git status -s', capture=True).splitlines()
return local('%s status -s' % GIT_BINARY, capture=True).splitlines()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment