[Asterisk-code-review] digium git: Repo's current branch set too late (repotools[master])

Kevin Harwell asteriskteam at digium.com
Thu Feb 4 11:10:32 CST 2016


Kevin Harwell has uploaded a new change for review.

  https://gerrit.asterisk.org/2194

Change subject: digium_git: Repo's current branch set too late
......................................................................

digium_git: Repo's current branch set too late

When checking out a remote branch the current_branch field was being set after
a potential call to push_changes. push_changes needs this value to be set or it
will assert. This moves the setting of current_branch to before the call.

Change-Id: Idd9bf79c2e367e23d53e8e76e84b4bdbb9fb5138
---
M digium_git.py
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.asterisk.org:29418/repotools refs/changes/94/2194/1

diff --git a/digium_git.py b/digium_git.py
index d54b326..05a5454 100644
--- a/digium_git.py
+++ b/digium_git.py
@@ -164,6 +164,7 @@
         if not local_name:
             local_name = branch_name
 
+        self.current_branch = local_name
         origin = self.repo.remotes.origin
         if local_name in self.repo.heads:
             # Local version already exists, just use it
@@ -176,7 +177,6 @@
             local_branch.set_tracking_branch(remote_ref)
             self.push_changes()
 
-        self.current_branch = local_name
         local_branch.checkout()
 	origin.pull(refspec=['refs/heads/{0}:refs/heads/{0}'.format(local_name)])
 

-- 
To view, visit https://gerrit.asterisk.org/2194
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idd9bf79c2e367e23d53e8e76e84b4bdbb9fb5138
Gerrit-PatchSet: 1
Gerrit-Project: repotools
Gerrit-Branch: master
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>



More information about the asterisk-code-review mailing list