From 97016383052fcdb880e85b4db746eef83b4f2e81 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Mon, 6 Jun 2011 20:21:40 -0400 Subject: [PATCH] bugfix in branch names with .git checkout --- irc/commands/git.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/irc/commands/git.py b/irc/commands/git.py index 7b76cf8..9ca793d 100644 --- a/irc/commands/git.py +++ b/irc/commands/git.py @@ -101,12 +101,13 @@ class Git(BaseCommand): self.connection.reply(self.data, "switch to which branch?") return + current_branch = self.exec_shell("git name-rev --name-only HEAD") + try: result = self.exec_shell("git checkout %s" % branch) if "Already on" in result: self.connection.reply(self.data, "already on \x0302%s\x0301!" % branch) else: - current_branch = self.exec_shell("git name-rev --name-only HEAD") self.connection.reply(self.data, "switched from branch \x0302%s\x0301 to \x0302%s\x0301." % (current_branch, branch)) except subprocess.CalledProcessError: # git couldn't switch branches