From d16986484add8d9f234650f588fe04fad25ce76d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Fri, 25 Jul 2014 15:06:56 -0700 Subject: [PATCH] Fix `browse` command when on detached HEAD --- commands/browse.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/commands/browse.go b/commands/browse.go index db2e51e1..93ab8de5 100644 --- a/commands/browse.go +++ b/commands/browse.go @@ -77,7 +77,9 @@ func browse(command *Command, args *Args) { utils.Check(err) } else { currentBranch, err := localRepo.CurrentBranch() - utils.Check(err) + if err != nil { + currentBranch = localRepo.MasterBranch() + } branch, project, _ = localRepo.RemoteBranchAndProject("", currentBranch.IsMaster()) if branch == nil { -- GitLab