瀏覽代碼

bugfix in branch names with .git checkout

tags/v0.1^2
Ben Kurtovic 13 年之前
父節點
當前提交
9701638305
共有 1 個檔案被更改,包括 2 行新增1 行删除
  1. +2
    -1
      irc/commands/git.py

+ 2
- 1
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


Loading…
取消
儲存