diff --git a/git.py b/git.py index 1850f8ff480f69c160f80fbdb7a04bd45bd0ff8a..5d1cb3397aea345765c223b9616023a28c9189f0 100644 --- a/git.py +++ b/git.py @@ -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()