From 9a09094080038c9537e9d4d53bd34583b07855d1 Mon Sep 17 00:00:00 2001 From: jolheiser Date: Tue, 4 Oct 2022 09:00:02 -0500 Subject: [PATCH] remove isClean Fixes #1 Signed-off-by: jolheiser --- cmd/backport.go | 5 ----- cmd/branch.go | 2 +- cmd/frontport.go | 5 ----- 3 files changed, 1 insertion(+), 11 deletions(-) diff --git a/cmd/backport.go b/cmd/backport.go index 885596e..2164c11 100644 --- a/cmd/backport.go +++ b/cmd/backport.go @@ -11,7 +11,6 @@ import ( "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" "github.com/peterbourgon/ff/v3/ffcli" - "github.com/rs/zerolog/log" "github.com/skratchdot/open-golang/open" ) @@ -47,10 +46,6 @@ func (h *Handler) Backport() *ffcli.Command { h.fetch(ctx) - if isClean() { - log.Fatal().Msg("working tree is dirty") - } - from := *fromFlag if from == "" { from = "main" diff --git a/cmd/branch.go b/cmd/branch.go index 56a6bea..726d159 100644 --- a/cmd/branch.go +++ b/cmd/branch.go @@ -57,7 +57,7 @@ func (h *Handler) Branch() *ffcli.Command { case strings.HasPrefix(base, "u/"): base = "upstream/" + strings.TrimPrefix(base, "u/") } - if (!strings.HasPrefix(base, "upstream") || !strings.HasPrefix(base, "origin")) && !strings.HasPrefix(base, "pr-") { + if !strings.HasPrefix(base, "upstream") && !strings.HasPrefix(base, "origin") && !strings.HasPrefix(base, "pr-") { base = fmt.Sprintf("upstream/%s", base) } diff --git a/cmd/frontport.go b/cmd/frontport.go index 9a0e3e7..86b4bdb 100644 --- a/cmd/frontport.go +++ b/cmd/frontport.go @@ -11,7 +11,6 @@ import ( "github.com/go-git/go-git/v5/plumbing" "github.com/go-git/go-git/v5/plumbing/object" "github.com/peterbourgon/ff/v3/ffcli" - "github.com/rs/zerolog/log" ) func (h *Handler) Frontport() *ffcli.Command { @@ -40,10 +39,6 @@ func (h *Handler) Frontport() *ffcli.Command { h.fetch(ctx) - if !isClean() { - log.Fatal().Msg("working tree is dirty") - } - commits, err := h.repo().Log(&git.LogOptions{ From: h.head(from), })