From fd059a3df223dd8bfaf381d5ef8adb6ee7105acf Mon Sep 17 00:00:00 2001 From: Stephen Fromm Date: Fri, 20 Jul 2012 10:43:26 -0700 Subject: [PATCH] Fix for issue 604 Do not switch to master branch in pull() Add --track to git checkout, when checking out a remote branch to track. --- library/git | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/library/git b/library/git index 8f5c198a90e..2f3076e1efa 100755 --- a/library/git +++ b/library/git @@ -148,10 +148,9 @@ def pull(repo, dest, branch): else: m = re.search( '^\s+%s$' % branch, gbranch_out, flags=re.M ) #see if we've already checked it out if m is None: - cmd = "git checkout -b %s origin/%s" % (branch, branch) + cmd = "git checkout --track -b %s origin/%s" % (branch, branch) else: - (out, err) = switchLocalBranch( branch ) cmd = "git pull -u origin" cmd = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)