Skip to content

Commit

Permalink
BF: after a first push the remote still appeared empty (so 1st push a…
Browse files Browse the repository at this point in the history
…gain)

Needed to refresh the representation of the remote, either after a firts
push or before any sync (we went for the latter)
  • Loading branch information
peircej committed Jan 31, 2019
1 parent 2e47048 commit f4134a6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion psychopy/projects/pavlovia.py
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,11 @@ def getRepo(self, infoStream=None, forceRefresh=False,
"""Will always try to return a valid local git repo
Will try to clone if local is empty and remote is not"""

# refresh our representation of the local
if self.repo and not forceRefresh:
return self.repo

if not self.localRoot:
raise AttributeError("Cannot fetch a PavloviaProject until we have "
"chosen a local folder.")
Expand All @@ -748,6 +751,10 @@ def getRepo(self, infoStream=None, forceRefresh=False,
self.configGitLocal()

self.writeGitIgnore()
# also refresh our representation of the remote
if self.pavlovia and forceRefresh:
self.pavlovia = getCurrentSession().gitlab.projects.get(self.id)

return self.repo

def writeGitIgnore(self):
Expand Down Expand Up @@ -809,7 +816,7 @@ def firstPush(self, infoStream):
if infoStream:
infoStream.write("\n{}".format(info))
infoStream.write("\nSuccess!".format(info))

def cloneRepo(self, infoStream=None):
"""Gets the git.Repo object for this project, creating one if needed
Expand Down

0 comments on commit f4134a6

Please sign in to comment.