From d3100bd866cb5339b897378894f79bcd51ede89c Mon Sep 17 00:00:00 2001 From: "Anthony G. Basile" Date: Tue, 6 Feb 2018 06:57:31 -0500 Subject: grs/Synchronize.py: checkout the branch before updating the submodule --- grs/Synchronize.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/grs/Synchronize.py b/grs/Synchronize.py index 8a55c84..d2d4cb5 100644 --- a/grs/Synchronize.py +++ b/grs/Synchronize.py @@ -43,6 +43,10 @@ class Synchronize(): cmd = 'git clone %s %s' % (self.remote_repo, self.local_repo) Execute(cmd, timeout=60, logfile=self.logfile) + # Make sure we're on the correct branch for the desired GRS system. + cmd = 'git -C %s checkout %s' % (self.local_repo, self.branch) + Execute(cmd, timeout=60, logfile=self.logfile) + # If there is a .gitmodules, then init/update the submodules git_modulesfile = os.path.join(self.local_repo, '.gitmodules') if os.path.isfile(git_modulesfile): @@ -53,10 +57,6 @@ class Synchronize(): cmd = 'git -C %s submodule update' % self.local_repo Execute(cmd, timeout=60, logfile=self.logfile) - # Make sure we're on the correct branch for the desired GRS system. - cmd = 'git -C %s checkout %s' % (self.local_repo, self.branch) - Execute(cmd, timeout=60, logfile=self.logfile) - def isgitdir(self): """ If there is a .git/config file, assume its a local git repository. """ -- cgit v1.2.3-65-gdbad