Change IDE to nvim and add way to open origin branch
ci/woodpecker/push/goreleaser Pipeline was successful
Details
ci/woodpecker/push/goreleaser Pipeline was successful
Details
Signed-off-by: jolheiser <john.olheiser@gmail.com>main
parent
64cfe82797
commit
1622f99d5d
|
@ -6,7 +6,6 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/peterbourgon/ff/v3/ffcli"
|
"github.com/peterbourgon/ff/v3/ffcli"
|
||||||
|
@ -52,7 +51,13 @@ func (h *Handler) Branch() *ffcli.Command {
|
||||||
|
|
||||||
name := args[0]
|
name := args[0]
|
||||||
base := *baseFlag
|
base := *baseFlag
|
||||||
if !strings.HasPrefix(base, "upstream") && !strings.HasPrefix(base, "pr-") {
|
switch {
|
||||||
|
case strings.HasPrefix(base, "o/"):
|
||||||
|
base = "origin/" + strings.TrimPrefix(base, "o/")
|
||||||
|
case strings.HasPrefix(base, "u/"):
|
||||||
|
base = "upstream/" + strings.TrimPrefix(base, "u/")
|
||||||
|
}
|
||||||
|
if (!strings.HasPrefix(base, "upstream") || !strings.HasPrefix(base, "origin")) && !strings.HasPrefix(base, "pr-") {
|
||||||
base = fmt.Sprintf("upstream/%s", base)
|
base = fmt.Sprintf("upstream/%s", base)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +65,7 @@ func (h *Handler) Branch() *ffcli.Command {
|
||||||
h.fetch(ctx)
|
h.fetch(ctx)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := h.run(ctx, "git", "worktree", "add", "-B", name, filepath.Join(h.Config.Workspace(), name), base); err != nil {
|
if err := h.run(ctx, "git", "worktree", "add", "-B", name, h.Config.WorkspaceBranch(name), base); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue