Skip to content

Commit

Permalink
Merge pull request #3626 from peircej/hotfix-git-check-branch
Browse files Browse the repository at this point in the history
BF: Builder failing to sync new git projects
  • Loading branch information
peircej committed Feb 24, 2021
2 parents f733e35 + 33b3d80 commit b8027ee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions psychopy/projects/pavlovia.py
Original file line number Diff line number Diff line change
Expand Up @@ -1045,8 +1045,13 @@ def getGitRoot(p):
if not p.is_dir():
p = p.parent # given a file instead of folder?

if 'not a git repository' in subprocess.check_output(["git", "branch", "--show-current"],
cwd=str(p)).decode('utf-8'):
proc = subprocess.Popen('git branch --show-current',
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
cwd=str(p), shell=True,
universal_newlines=True) # newlines forces stdout to unicode
stdout, stderr = proc.communicate()
if 'not a git repository' in (stdout + stderr):
return None
else:
# this should have been possible with git rev-parse --top-level
Expand Down

0 comments on commit b8027ee

Please sign in to comment.