From 0c4b1bbee39f777372a77e4c7dec16d2a1009498 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Tue, 27 Jul 2010 14:54:15 +0200 Subject: [PATCH] revert (reset) before changing branch in git repos --- module-tools.py | 2 ++ 1 file changed, 2 insertions(+) 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): -- 2.43.0