From 7cb6fb2b4320534c13df9ff7b824ffb31f954ca0 Mon Sep 17 00:00:00 2001 From: Ben Kurtovic Date: Mon, 25 Apr 2011 16:33:49 -0400 Subject: [PATCH] make git checkout print original branch in addition to new branch --- 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 0b63576..0c7e9b2 100644 --- a/irc/commands/git.py +++ b/irc/commands/git.py @@ -106,7 +106,8 @@ class Git(BaseCommand): if "Already on" in result: self.connection.reply(self.data, "already on \x0302%s\x0301!" % branch) else: - self.connection.reply(self.data, "switched to branch \x0302%s\x0301." % branch) + 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 self.connection.reply(self.data, "branch \x0302%s\x0301 doesn't exist!" % branch)