From: Barış Metin Date: Tue, 27 Jul 2010 12:54:15 +0000 (+0200) Subject: revert (reset) before changing branch in git repos X-Git-Tag: 5.0-rc15~54 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=0c4b1bbee39f777372a77e4c7dec16d2a1009498;p=build.git revert (reset) before changing branch in git repos --- diff --git a/module-tools.py b/module-tools.py index 4a4a8793..ea90f56c 100755 --- a/module-tools.py +++ b/module-tools.py @@ -308,6 +308,7 @@ class GitRepository: self.__run_command_in_repo("git merge --ff origin/%s" % branch) def to_branch(self, branch, remote=True): + self.revert() if remote: command = "git branch --track %s origin/%s" % (branch, branch) c = Command(command, self.options) @@ -315,6 +316,7 @@ class GitRepository: return self.__run_command_in_repo("git checkout %s" % branch) def to_tag(self, tag): + self.revert() return self.__run_command_in_repo("git checkout %s" % tag) def tag(self, tagname, logfile):