From 2d25c59c00054b5c1ef51248e3bf8c4081926c8c Mon Sep 17 00:00:00 2001 From: Jan De Dobbeleer Date: Tue, 9 Nov 2021 17:13:47 +0100 Subject: [PATCH] fix(git): remove Repo struct --- docs/docs/beta.mdx | 2 +- docs/docs/segment-git.mdx | 32 +++--- src/segment_git.go | 137 +++++++++++++------------- src/segment_git_deprecated.go | 36 +++---- src/segment_git_deprecated_test.go | 44 ++------- src/segment_git_test.go | 87 +++++++--------- themes/M365Princess.omp.json | 2 +- themes/agnoster.omp.json | 2 +- themes/agnosterplus.omp.json | 2 +- themes/aliens.omp.json | 2 +- themes/amro.omp.json | 2 +- themes/avit.omp.json | 2 +- themes/blue-owl.omp.json | 10 +- themes/blueish.omp.json | 2 +- themes/bubbles.omp.json | 2 +- themes/bubblesline.omp.json | 2 +- themes/cert.omp.json | 2 +- themes/cinnamon.omp.json | 2 +- themes/craver.omp.json | 2 +- themes/darkblood.omp.json | 2 +- themes/emodipt.omp.json | 2 +- themes/fish.omp.json | 2 +- themes/gmay.omp.json | 2 +- themes/half-life.omp.json | 2 +- themes/honukai.omp.json | 2 +- themes/hotstick.minimal.omp.json | 4 +- themes/hunk.omp.json | 10 +- themes/huvix.omp.json | 2 +- themes/iterm2.omp.json | 10 +- themes/jandedobbeleer.omp.json | 10 +- themes/jblab_2021.omp.json | 10 +- themes/jonnychipz.omp.json | 8 +- themes/jtracey93.omp.json | 2 +- themes/jv_sitecorian.omp.json | 10 +- themes/lambda.omp.json | 2 +- themes/marcduiker.omp.json | 10 +- themes/material.omp.json | 2 +- themes/microverse-power.omp.json | 2 +- themes/mojada.omp.json | 10 +- themes/mt.omp.json | 2 +- themes/negligible.omp.json | 2 +- themes/night-owl.omp.json | 10 +- themes/nu4a.omp.json | 2 +- themes/paradox.omp.json | 2 +- themes/pararussel.omp.json | 2 +- themes/patriksvensson.omp.json | 10 +- themes/pixelrobots.omp.json | 8 +- themes/plague.omp.json | 2 +- themes/powerlevel10k_classic.omp.json | 2 +- themes/powerlevel10k_lean.omp.json | 2 +- themes/powerlevel10k_modern.omp.json | 2 +- themes/powerlevel10k_rainbow.omp.json | 10 +- themes/powerline.omp.json | 2 +- themes/pure.omp.json | 2 +- themes/remk.omp.json | 2 +- themes/robbyrussel.omp.json | 2 +- themes/rudolfs-dark.omp.json | 2 +- themes/rudolfs-light.omp.json | 6 +- themes/slim.omp.json | 8 +- themes/slimfat.omp.json | 8 +- themes/sorin.omp.json | 2 +- themes/space.omp.json | 2 +- themes/spaceship.omp.json | 2 +- themes/star.omp.json | 2 +- themes/stelbent.minimal.omp.json | 10 +- themes/tonybaloney.omp.json | 2 +- themes/unicorn.omp.json | 10 +- themes/wopian.omp.json | 2 +- themes/xtoys.omp.json | 2 +- themes/ys.omp.json | 2 +- themes/zash.omp.json | 2 +- 71 files changed, 280 insertions(+), 322 deletions(-) diff --git a/docs/docs/beta.mdx b/docs/docs/beta.mdx index 33bd8db2..e589fdf7 100644 --- a/docs/docs/beta.mdx +++ b/docs/docs/beta.mdx @@ -43,7 +43,7 @@ You need to extend or create a custom theme with your tooltips. For example: "properties": { "fetch_status": true, "fetch_upstream_icon": true, - "template": "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}" + "template": "{{ .HEAD }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}" } } ] diff --git a/docs/docs/segment-git.mdx b/docs/docs/segment-git.mdx index b556fbc0..8a5b5b30 100644 --- a/docs/docs/segment-git.mdx +++ b/docs/docs/segment-git.mdx @@ -37,16 +37,16 @@ An alternative is to use the [Posh-Git segment][poshgit] "foreground": "#193549", "background": "#ffeb3b", "background_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#FFEB3B{{ end }}", - "{{ if and (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}#FFCC80{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#B388FF{{ end }}", - "{{ if gt .Repo.Behind 0 }}#B388FB{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#FFEB3B{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#FFCC80{{ end }}", + "{{ if gt .Ahead 0 }}#B388FF{{ end }}", + "{{ if gt .Behind 0 }}#B388FB{{ end }}" ], "properties": { "fetch_status": true, "fetch_stash_count": true, "fetch_upstream_icon": true, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } } ``` @@ -97,17 +97,17 @@ You can set the following properties to `true` to enable fetching additional inf ## Template Properties -- `.Repo.Working`: `GitStatus` - changes in the working tree (see below) -- `.Repo.Staging`: `GitStatus` - staged changes in the work tree (see below) -- `.Repo.HEAD`: `string` - the current HEAD context (branch/rebase/merge/...) -- `.Repo.Behind`: `int` - commits behind of upstream -- `.Repo.Ahead`: `int` - commits ahead of upstream -- `.Repo.BranchStatus`: `string` - the current branch context (ahead/behind string representation) -- `.Repo.Upstream`: `string` - the upstream name (remote) -- `.Repo.UpstreamIcon`: `string` - the upstream icon (based on the icons above) -- `.Repo.StashCount`: `int` - the stash count -- `.Repo.WorktreeCount`: `int` - the worktree count -- `.Repo.IsWorkTree`: `boolean` - if in a worktree repo or not +- `.Working`: `GitStatus` - changes in the working tree (see below) +- `.Staging`: `GitStatus` - staged changes in the work tree (see below) +- `.HEAD`: `string` - the current HEAD context (branch/rebase/merge/...) +- `.Behind`: `int` - commits behind of upstream +- `.Ahead`: `int` - commits ahead of upstream +- `.BranchStatus`: `string` - the current branch context (ahead/behind string representation) +- `.Upstream`: `string` - the upstream name (remote) +- `.UpstreamIcon`: `string` - the upstream icon (based on the icons above) +- `.StashCount`: `int` - the stash count +- `.WorktreeCount`: `int` - the worktree count +- `.IsWorkTree`: `boolean` - if in a worktree repo or not ### GitStatus diff --git a/src/segment_git.go b/src/segment_git.go index 0eda3ee7..5f00ec71 100644 --- a/src/segment_git.go +++ b/src/segment_git.go @@ -8,24 +8,6 @@ import ( "gopkg.in/ini.v1" ) -// Repo represents a git repository -type Repo struct { - Working *GitStatus - Staging *GitStatus - Ahead int - Behind int - HEAD string - BranchStatus string - Upstream string - UpstreamIcon string - StashCount int - WorktreeCount int - IsWorkTree bool - - gitWorkingFolder string // .git working folder, can be different of root if using worktree - gitRootFolder string // .git root folder -} - // GitStatus represents part of the status of a git repository type GitStatus struct { Unmerged int @@ -83,7 +65,21 @@ func (s *GitStatus) String() string { type git struct { props *properties env environmentInfo - Repo *Repo + + Working *GitStatus + Staging *GitStatus + Ahead int + Behind int + HEAD string + BranchStatus string + Upstream string + UpstreamIcon string + StashCount int + WorktreeCount int + IsWorkTree bool + + gitWorkingFolder string // .git working folder, can be different of root if using worktree + gitRootFolder string // .git root folder } const ( @@ -146,28 +142,27 @@ func (g *git) enabled() bool { return false } - g.Repo = &Repo{ - Staging: &GitStatus{}, - Working: &GitStatus{}, - } + g.Staging = &GitStatus{} + g.Working = &GitStatus{} + if gitdir.isDir { - g.Repo.gitWorkingFolder = gitdir.path - g.Repo.gitRootFolder = gitdir.path + g.gitWorkingFolder = gitdir.path + g.gitRootFolder = gitdir.path return true } // handle worktree - g.Repo.gitRootFolder = gitdir.path + g.gitRootFolder = gitdir.path dirPointer := g.env.getFileContent(gitdir.path) dirPointer = strings.Trim(dirPointer, " \r\n") matches := findNamedRegexMatch(`^gitdir: (?P.*)$`, dirPointer) if matches != nil && matches["dir"] != "" { - g.Repo.gitWorkingFolder = matches["dir"] + g.gitWorkingFolder = matches["dir"] // in worktrees, the path looks like this: gitdir: path/.git/worktrees/branch // strips the last .git/worktrees part // :ind+5 = index + /.git - ind := strings.LastIndex(g.Repo.gitWorkingFolder, "/.git/worktrees") - g.Repo.gitRootFolder = g.Repo.gitWorkingFolder[:ind+5] - g.Repo.IsWorkTree = true + ind := strings.LastIndex(g.gitWorkingFolder, "/.git/worktrees") + g.gitRootFolder = g.gitWorkingFolder[:ind+5] + g.IsWorkTree = true return true } return false @@ -189,19 +184,19 @@ func (g *git) string() string { statusColorsEnabled := g.props.getBool(StatusColorsEnabled, false) displayStatus := g.getBool(FetchStatus, DisplayStatus) if !displayStatus { - g.Repo.HEAD = g.getPrettyHEADName() + g.HEAD = g.getPrettyHEADName() } if displayStatus || statusColorsEnabled { g.setGitStatus() } - if g.Repo.Upstream != "" && g.getBool(FetchUpstreamIcon, DisplayUpstreamIcon) { - g.Repo.UpstreamIcon = g.getUpstreamIcon() + if g.Upstream != "" && g.getBool(FetchUpstreamIcon, DisplayUpstreamIcon) { + g.UpstreamIcon = g.getUpstreamIcon() } if g.getBool(FetchStashCount, DisplayStashCount) { - g.Repo.StashCount = g.getStashContext() + g.StashCount = g.getStashContext() } if g.getBool(FetchWorktreeCount, DisplayWorktreeCount) { - g.Repo.WorktreeCount = g.getWorktreeContext() + g.WorktreeCount = g.getWorktreeContext() } // use template if available segmentTemplate := g.props.getString(SegmentTemplate, "") @@ -232,26 +227,26 @@ func (g *git) init(props *properties, env environmentInfo) { } func (g *git) getBranchStatus() string { - if g.Repo.Ahead > 0 && g.Repo.Behind > 0 { - return fmt.Sprintf(" %s%d %s%d", g.props.getString(BranchAheadIcon, "\u2191"), g.Repo.Ahead, g.props.getString(BranchBehindIcon, "\u2193"), g.Repo.Behind) + if g.Ahead > 0 && g.Behind > 0 { + return fmt.Sprintf(" %s%d %s%d", g.props.getString(BranchAheadIcon, "\u2191"), g.Ahead, g.props.getString(BranchBehindIcon, "\u2193"), g.Behind) } - if g.Repo.Ahead > 0 { - return fmt.Sprintf(" %s%d", g.props.getString(BranchAheadIcon, "\u2191"), g.Repo.Ahead) + if g.Ahead > 0 { + return fmt.Sprintf(" %s%d", g.props.getString(BranchAheadIcon, "\u2191"), g.Ahead) } - if g.Repo.Behind > 0 { - return fmt.Sprintf(" %s%d", g.props.getString(BranchBehindIcon, "\u2193"), g.Repo.Behind) + if g.Behind > 0 { + return fmt.Sprintf(" %s%d", g.props.getString(BranchBehindIcon, "\u2193"), g.Behind) } - if g.Repo.Behind == 0 && g.Repo.Ahead == 0 && g.Repo.Upstream != "" { + if g.Behind == 0 && g.Ahead == 0 && g.Upstream != "" { return fmt.Sprintf(" %s", g.props.getString(BranchIdenticalIcon, "\u2261")) } - if g.Repo.Upstream == "" { + if g.Upstream == "" { return fmt.Sprintf(" %s", g.props.getString(BranchGoneIcon, "\u2262")) } return "" } func (g *git) getUpstreamIcon() string { - upstream := replaceAllString("/.*", g.Repo.Upstream, "") + upstream := replaceAllString("/.*", g.Upstream, "") url := g.getOriginURL(upstream) if strings.Contains(url, "github") { return g.props.getString(GithubIcon, "\uF408 ") @@ -271,18 +266,18 @@ func (g *git) getUpstreamIcon() string { func (g *git) setGitStatus() { output := g.getGitCommandOutput("status", "-unormal", "--short", "--branch") splittedOutput := strings.Split(output, "\n") - g.Repo.Working.parse(splittedOutput, true) - g.Repo.Staging.parse(splittedOutput, false) + g.Working.parse(splittedOutput, true) + g.Staging.parse(splittedOutput, false) status := g.parseGitStatusInfo(splittedOutput[0]) if status["local"] != "" { - g.Repo.Ahead, _ = strconv.Atoi(status["ahead"]) - g.Repo.Behind, _ = strconv.Atoi(status["behind"]) + g.Ahead, _ = strconv.Atoi(status["ahead"]) + g.Behind, _ = strconv.Atoi(status["behind"]) if status["upstream_status"] != "gone" { - g.Repo.Upstream = status["upstream"] + g.Upstream = status["upstream"] } } - g.Repo.HEAD = g.getGitHEADContext(status["local"]) - g.Repo.BranchStatus = g.getBranchStatus() + g.HEAD = g.getGitHEADContext(status["local"]) + g.BranchStatus = g.getBranchStatus() } func (g *git) getGitCommand() string { @@ -297,7 +292,7 @@ func (g *git) getGitCommand() string { } func (g *git) getGitCommandOutput(args ...string) string { - args = append([]string{"-C", strings.TrimSuffix(g.Repo.gitRootFolder, ".git"), "--no-optional-locks", "-c", "core.quotepath=false", "-c", "color.status=false"}, args...) + args = append([]string{"-C", strings.TrimSuffix(g.gitRootFolder, ".git"), "--no-optional-locks", "-c", "core.quotepath=false", "-c", "color.status=false"}, args...) val, _ := g.env.runCommand(g.getGitCommand(), args...) return val } @@ -311,30 +306,30 @@ func (g *git) getGitHEADContext(ref string) string { ref = fmt.Sprintf("%s%s", branchIcon, ref) } // rebase - if g.env.hasFolder(g.Repo.gitWorkingFolder + "/rebase-merge") { - head := g.getGitFileContents(g.Repo.gitWorkingFolder, "rebase-merge/head-name") + if g.env.hasFolder(g.gitWorkingFolder + "/rebase-merge") { + head := g.getGitFileContents(g.gitWorkingFolder, "rebase-merge/head-name") origin := strings.Replace(head, "refs/heads/", "", 1) origin = g.truncateBranch(origin) onto := g.getGitRefFileSymbolicName("rebase-merge/onto") onto = g.truncateBranch(onto) - step := g.getGitFileContents(g.Repo.gitWorkingFolder, "rebase-merge/msgnum") - total := g.getGitFileContents(g.Repo.gitWorkingFolder, "rebase-merge/end") + step := g.getGitFileContents(g.gitWorkingFolder, "rebase-merge/msgnum") + total := g.getGitFileContents(g.gitWorkingFolder, "rebase-merge/end") icon := g.props.getString(RebaseIcon, "\uE728 ") return fmt.Sprintf("%s%s%s onto %s%s (%s/%s) at %s", icon, branchIcon, origin, branchIcon, onto, step, total, ref) } - if g.env.hasFolder(g.Repo.gitWorkingFolder + "/rebase-apply") { - head := g.getGitFileContents(g.Repo.gitWorkingFolder, "rebase-apply/head-name") + if g.env.hasFolder(g.gitWorkingFolder + "/rebase-apply") { + head := g.getGitFileContents(g.gitWorkingFolder, "rebase-apply/head-name") origin := strings.Replace(head, "refs/heads/", "", 1) origin = g.truncateBranch(origin) - step := g.getGitFileContents(g.Repo.gitWorkingFolder, "rebase-apply/next") - total := g.getGitFileContents(g.Repo.gitWorkingFolder, "rebase-apply/last") + step := g.getGitFileContents(g.gitWorkingFolder, "rebase-apply/next") + total := g.getGitFileContents(g.gitWorkingFolder, "rebase-apply/last") icon := g.props.getString(RebaseIcon, "\uE728 ") return fmt.Sprintf("%s%s%s (%s/%s) at %s", icon, branchIcon, origin, step, total, ref) } // merge if g.hasGitFile("MERGE_MSG") && g.hasGitFile("MERGE_HEAD") { icon := g.props.getString(MergeIcon, "\uE727 ") - mergeContext := g.getGitFileContents(g.Repo.gitWorkingFolder, "MERGE_MSG") + mergeContext := g.getGitFileContents(g.gitWorkingFolder, "MERGE_MSG") matches := findNamedRegexMatch(`Merge (?P(remote-tracking )?branch|commit|tag) '(?P.*)' into`, mergeContext) if matches != nil && matches["head"] != "" { @@ -357,15 +352,15 @@ func (g *git) getGitHEADContext(ref string) string { // reverts then CHERRY_PICK_HEAD/REVERT_HEAD will not exist so we have to read // the todo file. if g.hasGitFile("CHERRY_PICK_HEAD") { - sha := g.getGitFileContents(g.Repo.gitWorkingFolder, "CHERRY_PICK_HEAD") + sha := g.getGitFileContents(g.gitWorkingFolder, "CHERRY_PICK_HEAD") icon := g.props.getString(CherryPickIcon, "\uE29B ") return fmt.Sprintf("%s%s onto %s", icon, sha[0:6], ref) } else if g.hasGitFile("REVERT_HEAD") { - sha := g.getGitFileContents(g.Repo.gitWorkingFolder, "REVERT_HEAD") + sha := g.getGitFileContents(g.gitWorkingFolder, "REVERT_HEAD") icon := g.props.getString(RevertIcon, "\uF0E2 ") return fmt.Sprintf("%s%s onto %s", icon, sha[0:6], ref) } else if g.hasGitFile("sequencer/todo") { - todo := g.getGitFileContents(g.Repo.gitWorkingFolder, "sequencer/todo") + todo := g.getGitFileContents(g.gitWorkingFolder, "sequencer/todo") matches := findNamedRegexMatch(`^(?Pp|pick|revert)\s+(?P\S+)`, todo) if matches != nil && matches["sha"] != "" { action := matches["action"] @@ -392,7 +387,7 @@ func (g *git) truncateBranch(branch string) string { } func (g *git) hasGitFile(file string) bool { - return g.env.hasFilesInDir(g.Repo.gitWorkingFolder, file) + return g.env.hasFilesInDir(g.gitWorkingFolder, file) } func (g *git) getGitFileContents(folder, file string) string { @@ -400,13 +395,13 @@ func (g *git) getGitFileContents(folder, file string) string { } func (g *git) getGitRefFileSymbolicName(refFile string) string { - ref := g.getGitFileContents(g.Repo.gitWorkingFolder, refFile) + ref := g.getGitFileContents(g.gitWorkingFolder, refFile) return g.getGitCommandOutput("name-rev", "--name-only", "--exclude=tags/*", ref) } func (g *git) getPrettyHEADName() string { var ref string - HEAD := g.getGitFileContents(g.Repo.gitWorkingFolder, "HEAD") + HEAD := g.getGitFileContents(g.gitWorkingFolder, "HEAD") branchPrefix := "ref: refs/heads/" if strings.HasPrefix(HEAD, branchPrefix) { ref = strings.TrimPrefix(HEAD, branchPrefix) @@ -429,7 +424,7 @@ func (g *git) getPrettyHEADName() string { } func (g *git) getStashContext() int { - stashContent := g.getGitFileContents(g.Repo.gitRootFolder, "logs/refs/stash") + stashContent := g.getGitFileContents(g.gitRootFolder, "logs/refs/stash") if stashContent == "" { return 0 } @@ -438,10 +433,10 @@ func (g *git) getStashContext() int { } func (g *git) getWorktreeContext() int { - if !g.env.hasFolder(g.Repo.gitRootFolder + "/worktrees") { + if !g.env.hasFolder(g.gitRootFolder + "/worktrees") { return 0 } - worktreeFolders := g.env.getFoldersList(g.Repo.gitRootFolder + "/worktrees") + worktreeFolders := g.env.getFoldersList(g.gitRootFolder + "/worktrees") return len(worktreeFolders) } @@ -451,7 +446,7 @@ func (g *git) parseGitStatusInfo(branchInfo string) map[string]string { } func (g *git) getOriginURL(upstream string) string { - cfg, err := ini.Load(g.Repo.gitRootFolder + "/config") + cfg, err := ini.Load(g.gitRootFolder + "/config") if err != nil { return g.getGitCommandOutput("remote", "get-url", upstream) } diff --git a/src/segment_git_deprecated.go b/src/segment_git_deprecated.go index 13e6754b..52404a9a 100644 --- a/src/segment_git_deprecated.go +++ b/src/segment_git_deprecated.go @@ -58,28 +58,28 @@ func (g *git) renderDeprecatedString(statusColorsEnabled bool) string { } buffer := new(bytes.Buffer) // remote (if available) - if len(g.Repo.UpstreamIcon) != 0 { - fmt.Fprintf(buffer, "%s", g.Repo.UpstreamIcon) + if len(g.UpstreamIcon) != 0 { + fmt.Fprintf(buffer, "%s", g.UpstreamIcon) } // branchName - fmt.Fprintf(buffer, "%s", g.Repo.HEAD) - if len(g.Repo.BranchStatus) > 0 { - buffer.WriteString(g.Repo.BranchStatus) + fmt.Fprintf(buffer, "%s", g.HEAD) + if len(g.BranchStatus) > 0 { + buffer.WriteString(g.BranchStatus) } - if g.Repo.Staging.Changed { - fmt.Fprint(buffer, g.getStatusDetailString(g.Repo.Staging, StagingColor, LocalStagingIcon, " \uF046")) + if g.Staging.Changed { + fmt.Fprint(buffer, g.getStatusDetailString(g.Staging, StagingColor, LocalStagingIcon, " \uF046")) } - if g.Repo.Staging.Changed && g.Repo.Working.Changed { + if g.Staging.Changed && g.Working.Changed { fmt.Fprint(buffer, g.props.getString(StatusSeparatorIcon, " |")) } - if g.Repo.Working.Changed { - fmt.Fprint(buffer, g.getStatusDetailString(g.Repo.Working, WorkingColor, LocalWorkingIcon, " \uF044")) + if g.Working.Changed { + fmt.Fprint(buffer, g.getStatusDetailString(g.Working, WorkingColor, LocalWorkingIcon, " \uF044")) } - if g.Repo.StashCount != 0 { - fmt.Fprintf(buffer, " %s%d", g.props.getString(StashCountIcon, "\uF692 "), g.Repo.StashCount) + if g.StashCount != 0 { + fmt.Fprintf(buffer, " %s%d", g.props.getString(StashCountIcon, "\uF692 "), g.StashCount) } - if g.Repo.WorktreeCount != 0 { - fmt.Fprintf(buffer, " %s%d", g.props.getString(WorktreeCountIcon, "\uf1bb "), g.Repo.WorktreeCount) + if g.WorktreeCount != 0 { + fmt.Fprintf(buffer, " %s%d", g.props.getString(WorktreeCountIcon, "\uf1bb "), g.WorktreeCount) } return buffer.String() } @@ -93,13 +93,13 @@ func (g *git) SetStatusColor() { } func (g *git) getStatusColor(defaultValue string) string { - if g.Repo.Staging.Changed || g.Repo.Working.Changed { + if g.Staging.Changed || g.Working.Changed { return g.props.getColor(LocalChangesColor, defaultValue) - } else if g.Repo.Ahead > 0 && g.Repo.Behind > 0 { + } else if g.Ahead > 0 && g.Behind > 0 { return g.props.getColor(AheadAndBehindColor, defaultValue) - } else if g.Repo.Ahead > 0 { + } else if g.Ahead > 0 { return g.props.getColor(AheadColor, defaultValue) - } else if g.Repo.Behind > 0 { + } else if g.Behind > 0 { return g.props.getColor(BehindColor, defaultValue) } return defaultValue diff --git a/src/segment_git_deprecated_test.go b/src/segment_git_deprecated_test.go index c61d189c..5bcfe5fe 100644 --- a/src/segment_git_deprecated_test.go +++ b/src/segment_git_deprecated_test.go @@ -110,32 +110,26 @@ func TestGetStatusDetailStringNoStatusColorOverride(t *testing.T) { func TestGetStatusColorLocalChangesStaging(t *testing.T) { expected := changesColor - repo := &Repo{ - Staging: &GitStatus{ - Changed: true, - }, - } g := &git{ - Repo: repo, props: &properties{ values: map[Property]interface{}{ LocalChangesColor: expected, }, }, + Staging: &GitStatus{ + Changed: true, + }, } assert.Equal(t, expected, g.getStatusColor("#fg1111")) } func TestGetStatusColorLocalChangesWorking(t *testing.T) { expected := changesColor - repo := &Repo{ + g := &git{ Staging: &GitStatus{}, Working: &GitStatus{ Changed: true, }, - } - g := &git{ - Repo: repo, props: &properties{ values: map[Property]interface{}{ LocalChangesColor: expected, @@ -147,14 +141,11 @@ func TestGetStatusColorLocalChangesWorking(t *testing.T) { func TestGetStatusColorAheadAndBehind(t *testing.T) { expected := changesColor - repo := &Repo{ + g := &git{ Staging: &GitStatus{}, Working: &GitStatus{}, Ahead: 1, Behind: 3, - } - g := &git{ - Repo: repo, props: &properties{ values: map[Property]interface{}{ AheadAndBehindColor: expected, @@ -166,14 +157,11 @@ func TestGetStatusColorAheadAndBehind(t *testing.T) { func TestGetStatusColorAhead(t *testing.T) { expected := changesColor - repo := &Repo{ + g := &git{ Staging: &GitStatus{}, Working: &GitStatus{}, Ahead: 1, Behind: 0, - } - g := &git{ - Repo: repo, props: &properties{ values: map[Property]interface{}{ AheadColor: expected, @@ -185,14 +173,11 @@ func TestGetStatusColorAhead(t *testing.T) { func TestGetStatusColorBehind(t *testing.T) { expected := changesColor - repo := &Repo{ + g := &git{ Staging: &GitStatus{}, Working: &GitStatus{}, Ahead: 0, Behind: 5, - } - g := &git{ - Repo: repo, props: &properties{ values: map[Property]interface{}{ BehindColor: expected, @@ -204,14 +189,11 @@ func TestGetStatusColorBehind(t *testing.T) { func TestGetStatusColorDefault(t *testing.T) { expected := changesColor - repo := &Repo{ + g := &git{ Staging: &GitStatus{}, Working: &GitStatus{}, Ahead: 0, Behind: 0, - } - g := &git{ - Repo: repo, props: &properties{ values: map[Property]interface{}{ BehindColor: changesColor, @@ -223,13 +205,10 @@ func TestGetStatusColorDefault(t *testing.T) { func TestSetStatusColorForeground(t *testing.T) { expected := changesColor - repo := &Repo{ + g := &git{ Staging: &GitStatus{ Changed: true, }, - } - g := &git{ - Repo: repo, props: &properties{ values: map[Property]interface{}{ LocalChangesColor: changesColor, @@ -245,13 +224,10 @@ func TestSetStatusColorForeground(t *testing.T) { func TestSetStatusColorBackground(t *testing.T) { expected := changesColor - repo := &Repo{ + g := &git{ Staging: &GitStatus{ Changed: true, }, - } - g := &git{ - Repo: repo, props: &properties{ values: map[Property]interface{}{ LocalChangesColor: changesColor, diff --git a/src/segment_git_test.go b/src/segment_git_test.go index d1fadaf3..f46b743d 100644 --- a/src/segment_git_test.go +++ b/src/segment_git_test.go @@ -37,7 +37,7 @@ func TestEnabledInWorkingDirectory(t *testing.T) { env: env, } assert.True(t, g.enabled()) - assert.Equal(t, fileInfo.path, g.Repo.gitWorkingFolder) + assert.Equal(t, fileInfo.path, g.gitWorkingFolder) } func TestEnabledInWorkingTree(t *testing.T) { @@ -56,7 +56,7 @@ func TestEnabledInWorkingTree(t *testing.T) { env: env, } assert.True(t, g.enabled()) - assert.Equal(t, "/dir/hello/burp/burp", g.Repo.gitWorkingFolder) + assert.Equal(t, "/dir/hello/burp/burp", g.gitWorkingFolder) } func TestGetGitOutputForCommand(t *testing.T) { @@ -68,10 +68,8 @@ func TestGetGitOutputForCommand(t *testing.T) { env.On("runCommand", "git", append(args, commandArgs...)).Return(want, nil) env.On("getRuntimeGOOS", nil).Return("unix") g := &git{ - env: env, - Repo: &Repo{ - gitRootFolder: "test", - }, + env: env, + gitRootFolder: "test", } got := g.getGitCommandOutput(commandArgs...) assert.Equal(t, want, got) @@ -131,12 +129,10 @@ func setupHEADContextEnv(context *detachedContext) *git { env.mockGitCommand(context.status, "status", "-unormal", "--short", "--branch") env.On("getRuntimeGOOS", nil).Return("unix") g := &git{ - env: env, - Repo: &Repo{ - gitWorkingFolder: "", - Working: &GitStatus{}, - Staging: &GitStatus{}, - }, + env: env, + gitWorkingFolder: "", + Working: &GitStatus{}, + Staging: &GitStatus{}, } return g } @@ -387,10 +383,8 @@ func TestGetStashContextZeroEntries(t *testing.T) { env := new(MockedEnvironment) env.On("getFileContent", "/logs/refs/stash").Return(tc.StashContent) g := &git{ - Repo: &Repo{ - gitWorkingFolder: "", - }, - env: env, + env: env, + gitWorkingFolder: "", } got := g.getStashContext() assert.Equal(t, tc.Expected, got) @@ -569,11 +563,9 @@ func TestGitUpstream(t *testing.T) { }, } g := &git{ - env: env, - Repo: &Repo{ - Upstream: "origin/main", - }, - props: props, + env: env, + props: props, + Upstream: "origin/main", } upstreamIcon := g.getUpstreamIcon() assert.Equal(t, tc.Expected, upstreamIcon, tc.Case) @@ -606,11 +598,9 @@ func TestGetBranchStatus(t *testing.T) { BranchGoneIcon: "gone", }, }, - Repo: &Repo{ - Ahead: tc.Ahead, - Behind: tc.Behind, - Upstream: tc.Upstream, - }, + Ahead: tc.Ahead, + Behind: tc.Behind, + Upstream: tc.Upstream, } assert.Equal(t, tc.Expected, g.getBranchStatus(), tc.Case) } @@ -706,13 +696,13 @@ func TestGitTemplateString(t *testing.T) { Case string Expected string Template string - Repo *Repo + Git *git }{ { Case: "Only HEAD name", Expected: "main", - Template: "{{ .Repo.HEAD }}", - Repo: &Repo{ + Template: "{{ .HEAD }}", + Git: &git{ HEAD: "main", Behind: 2, }, @@ -720,8 +710,8 @@ func TestGitTemplateString(t *testing.T) { { Case: "Working area changes", Expected: "main \uF044 +2 ~3", - Template: "{{ .Repo.HEAD }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}", - Repo: &Repo{ + Template: "{{ .HEAD }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}", + Git: &git{ HEAD: "main", Working: &GitStatus{ Added: 2, @@ -733,8 +723,8 @@ func TestGitTemplateString(t *testing.T) { { Case: "No working area changes", Expected: "main", - Template: "{{ .Repo.HEAD }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}", - Repo: &Repo{ + Template: "{{ .HEAD }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}", + Git: &git{ HEAD: "main", Working: &GitStatus{ Changed: false, @@ -744,8 +734,8 @@ func TestGitTemplateString(t *testing.T) { { Case: "Working and staging area changes", Expected: "main \uF046 +5 ~1 \uF044 +2 ~3", - Template: "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}", - Repo: &Repo{ + Template: "{{ .HEAD }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}", + Git: &git{ HEAD: "main", Working: &GitStatus{ Added: 2, @@ -762,8 +752,8 @@ func TestGitTemplateString(t *testing.T) { { Case: "Working and staging area changes with separator", Expected: "main \uF046 +5 ~1 | \uF044 +2 ~3", - Template: "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}", //nolint:lll - Repo: &Repo{ + Template: "{{ .HEAD }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}", //nolint:lll + Git: &git{ HEAD: "main", Working: &GitStatus{ Added: 2, @@ -780,8 +770,8 @@ func TestGitTemplateString(t *testing.T) { { Case: "Working and staging area changes with separator and stash count", Expected: "main \uF046 +5 ~1 | \uF044 +2 ~3 \uf692 3", - Template: "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}", //nolint:lll - Repo: &Repo{ + Template: "{{ .HEAD }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}", //nolint:lll + Git: &git{ HEAD: "main", Working: &GitStatus{ Added: 2, @@ -799,8 +789,8 @@ func TestGitTemplateString(t *testing.T) { { Case: "No local changes", Expected: "main", - Template: "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046{{ .Repo.Staging.String }}{{ end }}{{ if .Repo.Working.Changed }} \uF044{{ .Repo.Working.String }}{{ end }}", - Repo: &Repo{ + Template: "{{ .HEAD }}{{ if .Staging.Changed }} \uF046{{ .Staging.String }}{{ end }}{{ if .Working.Changed }} \uF044{{ .Working.String }}{{ end }}", + Git: &git{ HEAD: "main", Staging: &GitStatus{}, Working: &GitStatus{}, @@ -809,8 +799,8 @@ func TestGitTemplateString(t *testing.T) { { Case: "Upstream Icon", Expected: "from GitHub on main", - Template: "from {{ .Repo.UpstreamIcon }} on {{ .Repo.HEAD }}", - Repo: &Repo{ + Template: "from {{ .UpstreamIcon }} on {{ .HEAD }}", + Git: &git{ HEAD: "main", Staging: &GitStatus{}, Working: &GitStatus{}, @@ -820,14 +810,11 @@ func TestGitTemplateString(t *testing.T) { } for _, tc := range cases { - g := &git{ - props: &properties{ - values: map[Property]interface{}{ - FetchStatus: true, - }, + tc.Git.props = &properties{ + values: map[Property]interface{}{ + FetchStatus: true, }, - Repo: tc.Repo, } - assert.Equal(t, tc.Expected, g.templateString(tc.Template), tc.Case) + assert.Equal(t, tc.Expected, tc.Git.templateString(tc.Template), tc.Case) } } diff --git a/themes/M365Princess.omp.json b/themes/M365Princess.omp.json index ddc1f54b..8138284c 100644 --- a/themes/M365Princess.omp.json +++ b/themes/M365Princess.omp.json @@ -39,7 +39,7 @@ "fetch_upstream_icon": true, "branch_icon": "", "fetch_status": false, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}", + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}", "prefix": " \u279C (", "postfix": ") " } diff --git a/themes/agnoster.omp.json b/themes/agnoster.omp.json index fd19ef47..82d128c3 100644 --- a/themes/agnoster.omp.json +++ b/themes/agnoster.omp.json @@ -39,7 +39,7 @@ "foreground": "#193549", "background": "#95ffa4", "properties": { - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/agnosterplus.omp.json b/themes/agnosterplus.omp.json index 1b875c5b..3833e92e 100644 --- a/themes/agnosterplus.omp.json +++ b/themes/agnosterplus.omp.json @@ -48,7 +48,7 @@ "foreground": "#193549", "background": "#95ffa4", "properties": { - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } } ] diff --git a/themes/aliens.omp.json b/themes/aliens.omp.json index 0b43282f..da2ab2a5 100644 --- a/themes/aliens.omp.json +++ b/themes/aliens.omp.json @@ -30,7 +30,7 @@ "foreground": "#193549", "background": "#95ffa4", "properties": { - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/amro.omp.json b/themes/amro.omp.json index 4cdf5b7a..7ea759e2 100644 --- a/themes/amro.omp.json +++ b/themes/amro.omp.json @@ -34,7 +34,7 @@ "fetch_stash_count": true, "fetch_upstream_icon": true, "prefix": "", - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } } ] diff --git a/themes/avit.omp.json b/themes/avit.omp.json index 3a1c3909..af75edfa 100644 --- a/themes/avit.omp.json +++ b/themes/avit.omp.json @@ -20,7 +20,7 @@ "foreground": "#C2C206", "properties": { "prefix": "", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/blue-owl.omp.json b/themes/blue-owl.omp.json index 78f2974d..88a80be2 100644 --- a/themes/blue-owl.omp.json +++ b/themes/blue-owl.omp.json @@ -50,15 +50,15 @@ "foreground": "#000000", "background": "#00C853", "background_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#FFEB3B{{ end }}", - "{{ if and (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}#FFCC80{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#B388FF{{ end }}", - "{{ if gt .Repo.Behind 0 }}#B388FF{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#FFEB3B{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#FFCC80{{ end }}", + "{{ if gt .Ahead 0 }}#B388FF{{ end }}", + "{{ if gt .Behind 0 }}#B388FF{{ end }}" ], "properties": { "fetch_stash_count": true, "fetch_status": true, - "template": "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }}<#FF6F00> \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .HEAD }}{{ if .Staging.Changed }}<#FF6F00> \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/blueish.omp.json b/themes/blueish.omp.json index c86b36e7..29dafacf 100644 --- a/themes/blueish.omp.json +++ b/themes/blueish.omp.json @@ -59,7 +59,7 @@ "properties": { "fetch_stash_count": true, "fetch_upstream_icon": true, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/bubbles.omp.json b/themes/bubbles.omp.json index 1baed879..05d8e0f6 100644 --- a/themes/bubbles.omp.json +++ b/themes/bubbles.omp.json @@ -43,7 +43,7 @@ "prefix": "", "postfix": "", "branch_icon": "", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/bubblesline.omp.json b/themes/bubblesline.omp.json index ab529879..1ec5b97e 100644 --- a/themes/bubblesline.omp.json +++ b/themes/bubblesline.omp.json @@ -28,7 +28,7 @@ "properties": { "prefix": "", "postfix": "", - "template": "{{ .Repo.HEAD }}", + "template": "{{ .HEAD }}", "branch_icon": "" } }, diff --git a/themes/cert.omp.json b/themes/cert.omp.json index 815c5915..effd1d75 100644 --- a/themes/cert.omp.json +++ b/themes/cert.omp.json @@ -41,7 +41,7 @@ "foreground": "#fff", "properties": { "branch_icon": "", - "template": "{{ .Repo.HEAD }}", + "template": "{{ .HEAD }}", "prefix": " git(", "postfix": ") " } diff --git a/themes/cinnamon.omp.json b/themes/cinnamon.omp.json index c12cd3dd..2e94ca5e 100644 --- a/themes/cinnamon.omp.json +++ b/themes/cinnamon.omp.json @@ -30,7 +30,7 @@ "properties": { "fetch_upstream_icon": true, "branch_icon": "", - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}" } }, { diff --git a/themes/craver.omp.json b/themes/craver.omp.json index 4d12bfe3..50a9e55e 100644 --- a/themes/craver.omp.json +++ b/themes/craver.omp.json @@ -63,7 +63,7 @@ "fetch_status": true, "fetch_stash_count": true, "fetch_upstream_icon": true, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}", + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}", "prefix": "" } }, diff --git a/themes/darkblood.omp.json b/themes/darkblood.omp.json index 84212a72..e0fb02a4 100644 --- a/themes/darkblood.omp.json +++ b/themes/darkblood.omp.json @@ -23,7 +23,7 @@ "properties": { "prefix": "<#CB4B16>[", "postfix": "<#CB4B16>]", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/emodipt.omp.json b/themes/emodipt.omp.json index 82d27dfd..c7d13741 100644 --- a/themes/emodipt.omp.json +++ b/themes/emodipt.omp.json @@ -34,7 +34,7 @@ "style": "plain", "foreground": "#F3C267", "properties": { - "template": "{{ .Repo.HEAD }}", + "template": "{{ .HEAD }}", "branch_identical_icon": "\uF14A", "branch_gone_icon": "\u274E" } diff --git a/themes/fish.omp.json b/themes/fish.omp.json index 17520ab0..8d831c51 100644 --- a/themes/fish.omp.json +++ b/themes/fish.omp.json @@ -44,7 +44,7 @@ "properties": { "prefix": "<#ffffff>\uE0B1 ", "postfix": " ", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/gmay.omp.json b/themes/gmay.omp.json index 3e6b18c2..e8e4c9b5 100644 --- a/themes/gmay.omp.json +++ b/themes/gmay.omp.json @@ -50,7 +50,7 @@ "properties": { "fetch_stash_count": true, "fetch_upstream_icon": true, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/half-life.omp.json b/themes/half-life.omp.json index b7df2929..af46a6d0 100644 --- a/themes/half-life.omp.json +++ b/themes/half-life.omp.json @@ -49,7 +49,7 @@ "rebase_icon": "", "cherry_pick_icon": "", "revert_icon": "", - "template": "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }}<#87FF00> ● {{ .Repo.Staging.String }}{{ end }}{{ if .Repo.Working.Changed }}<#D75F00> ● {{ .Repo.Working.String }}{{ end }}", + "template": "{{ .HEAD }}{{ if .Staging.Changed }}<#87FF00> ● {{ .Staging.String }}{{ end }}{{ if .Working.Changed }}<#D75F00> ● {{ .Working.String }}{{ end }}", "fetch_status": true } }, diff --git a/themes/honukai.omp.json b/themes/honukai.omp.json index 377a144b..adcbda42 100644 --- a/themes/honukai.omp.json +++ b/themes/honukai.omp.json @@ -32,7 +32,7 @@ "foreground": "#B8B80A", "properties": { "prefix": "<#ffffff>on git:", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } } ] diff --git a/themes/hotstick.minimal.omp.json b/themes/hotstick.minimal.omp.json index 82eaa60c..56e350d8 100644 --- a/themes/hotstick.minimal.omp.json +++ b/themes/hotstick.minimal.omp.json @@ -36,11 +36,11 @@ "foreground": "black", "background": "green", "background_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}yellow{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}yellow{{ end }}" ], "properties": { "fetch_status": true, - "template": "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}", + "template": "{{ .HEAD }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}", "branch_icon": " ", "branch_identical_icon": "≡", "branch_ahead_icon": "↑", diff --git a/themes/hunk.omp.json b/themes/hunk.omp.json index 0bb8929c..3f04318f 100644 --- a/themes/hunk.omp.json +++ b/themes/hunk.omp.json @@ -59,15 +59,15 @@ "foreground": "#ffffff", "background": "#caffbf", "background_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#FCA17D{{ end }}", - "{{ if and (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}#f26d50{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#89d1dc{{ end }}", - "{{ if gt .Repo.Behind 0 }}#f17c37{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#FCA17D{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#f26d50{{ end }}", + "{{ if gt .Ahead 0 }}#89d1dc{{ end }}", + "{{ if gt .Behind 0 }}#f17c37{{ end }}" ], "properties": { "fetch_upstream_icon": true, "fetch_status": true, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}" } } ] diff --git a/themes/huvix.omp.json b/themes/huvix.omp.json index 8ee2029b..a9ff94be 100644 --- a/themes/huvix.omp.json +++ b/themes/huvix.omp.json @@ -48,7 +48,7 @@ "foreground": "#56B6C2", "properties": { "branch_icon": "", - "template": "{{ .Repo.HEAD }}", + "template": "{{ .HEAD }}", "prefix": "<#E8CC97>git(", "postfix": "<#E8CC97>) " } diff --git a/themes/iterm2.omp.json b/themes/iterm2.omp.json index 35c3eb10..00fb7b9a 100644 --- a/themes/iterm2.omp.json +++ b/themes/iterm2.omp.json @@ -52,15 +52,15 @@ "foreground": "#193549", "background": "#d2ff5e", "background_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#ff9248{{ end }}", - "{{ if and (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}#f26d50{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#89d1dc{{ end }}", - "{{ if gt .Repo.Behind 0 }}#f17c37{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#ff9248{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#f26d50{{ end }}", + "{{ if gt .Ahead 0 }}#89d1dc{{ end }}", + "{{ if gt .Behind 0 }}#f17c37{{ end }}" ], "properties": { "fetch_status": true, "fetch_stash_count": true, - "template": "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .HEAD }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/jandedobbeleer.omp.json b/themes/jandedobbeleer.omp.json index 300f9df0..e59a9670 100644 --- a/themes/jandedobbeleer.omp.json +++ b/themes/jandedobbeleer.omp.json @@ -36,10 +36,10 @@ "foreground": "#193549", "background": "#fffb38", "background_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#FF9248{{ end }}", - "{{ if and (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}#ff4500{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#B388FF{{ end }}", - "{{ if gt .Repo.Behind 0 }}#B388FF{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#FF9248{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#ff4500{{ end }}", + "{{ if gt .Ahead 0 }}#B388FF{{ end }}", + "{{ if gt .Behind 0 }}#B388FF{{ end }}" ], "leading_diamond": "", "trailing_diamond": "", @@ -48,7 +48,7 @@ "fetch_stash_count": true, "fetch_upstream_icon": true, "branch_max_length": 25, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/jblab_2021.omp.json b/themes/jblab_2021.omp.json index 10226064..90230ded 100644 --- a/themes/jblab_2021.omp.json +++ b/themes/jblab_2021.omp.json @@ -49,10 +49,10 @@ "background": "#280C2E", "foreground": "#FFFFFF", "background_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#7621DE{{ end }}", - "{{ if and (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}#7621DE{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#7621DE{{ end }}", - "{{ if gt .Repo.Behind 0 }}#7621DE{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#7621DE{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#7621DE{{ end }}", + "{{ if gt .Ahead 0 }}#7621DE{{ end }}", + "{{ if gt .Behind 0 }}#7621DE{{ end }}" ], "powerline_symbol": "\uE0B0", "properties": { @@ -60,7 +60,7 @@ "fetch_status": true, "fetch_upstream_icon": true, "prefix": " ", - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" }, "style": "powerline", "type": "git" diff --git a/themes/jonnychipz.omp.json b/themes/jonnychipz.omp.json index 00d83e0d..f31d5792 100644 --- a/themes/jonnychipz.omp.json +++ b/themes/jonnychipz.omp.json @@ -120,16 +120,16 @@ "foreground": "#000000", "background": "#ffffff", "foreground_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#ffea00{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#2EC4B6{{ end }}", - "{{ if gt .Repo.Behind 0 }}#8A4FFF{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#ffea00{{ end }}", + "{{ if gt .Ahead 0 }}#2EC4B6{{ end }}", + "{{ if gt .Behind 0 }}#8A4FFF{{ end }}" ], "properties": { "fetch_stash_count": true, "fetch_upstream_icon": true, "fetch_status": true, "prefix": "<#000000>\ue0b1 ", - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }}<#2FDA4E> \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }}<#E84855> \uF044 {{ .Repo.Working.String }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ if .Staging.Changed }}<#2FDA4E> \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }}<#E84855> \uF044 {{ .Working.String }}{{ end }}" } }, { diff --git a/themes/jtracey93.omp.json b/themes/jtracey93.omp.json index b337e422..5cc6d1a4 100644 --- a/themes/jtracey93.omp.json +++ b/themes/jtracey93.omp.json @@ -30,7 +30,7 @@ "foreground": "#ffffff", "properties": { "fetch_status": true, - "template": "{{ .Repo.HEAD }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}", + "template": "{{ .HEAD }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}", "postfix": ") ", "prefix": " branch (" }, diff --git a/themes/jv_sitecorian.omp.json b/themes/jv_sitecorian.omp.json index aa353f0d..33d9ea4c 100644 --- a/themes/jv_sitecorian.omp.json +++ b/themes/jv_sitecorian.omp.json @@ -70,16 +70,16 @@ "foreground": "#ffffff", "background": "#6f42c1", "backround_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#176f2c{{ end }}", - "{{ if and (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}#f26d50{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#0366d6{{ end }}", - "{{ if gt .Repo.Behind 0 }}#f9c513{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#176f2c{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#f26d50{{ end }}", + "{{ if gt .Ahead 0 }}#0366d6{{ end }}", + "{{ if gt .Behind 0 }}#f9c513{{ end }}" ], "properties": { "fetch_stash_count": true, "fetch_status": true, "fetch_upstream_icon": true, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/lambda.omp.json b/themes/lambda.omp.json index d6fc67b7..ec01c9a5 100644 --- a/themes/lambda.omp.json +++ b/themes/lambda.omp.json @@ -28,7 +28,7 @@ "foreground": "#B80101", "properties": { "prefix": " <#F5F5F5>git:", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } } ] diff --git a/themes/marcduiker.omp.json b/themes/marcduiker.omp.json index 8cbce810..29ba3e97 100644 --- a/themes/marcduiker.omp.json +++ b/themes/marcduiker.omp.json @@ -23,17 +23,17 @@ "background": "#fee761", "foreground": "#262b44", "background_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#f77622{{ end }}", - "{{ if and (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}#e43b44{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#2ce8f5{{ end }}", - "{{ if gt .Repo.Behind 0 }}#f77622{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#f77622{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#e43b44{{ end }}", + "{{ if gt .Ahead 0 }}#2ce8f5{{ end }}", + "{{ if gt .Behind 0 }}#f77622{{ end }}" ], "powerline_symbol": "\uE0B0", "properties": { "fetch_status": true, "fetch_stash_count": true, "fetch_upstream_icon": true, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" }, "style": "powerline", "type": "git" diff --git a/themes/material.omp.json b/themes/material.omp.json index ea8473ec..85d10253 100644 --- a/themes/material.omp.json +++ b/themes/material.omp.json @@ -30,7 +30,7 @@ "properties": { "branch_icon": "", "fetch_status": false, - "template": "{{ .Repo.HEAD }}", + "template": "{{ .HEAD }}", "prefix": "<#5FAAE8>git:(", "postfix": "<#5FAAE8>)" } diff --git a/themes/microverse-power.omp.json b/themes/microverse-power.omp.json index 90f79d48..b076d26f 100644 --- a/themes/microverse-power.omp.json +++ b/themes/microverse-power.omp.json @@ -68,7 +68,7 @@ "fetch_stash_count": true, "fetch_upstream_icon": true, "prefix": "", - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/mojada.omp.json b/themes/mojada.omp.json index 15948fe6..b2e12351 100644 --- a/themes/mojada.omp.json +++ b/themes/mojada.omp.json @@ -71,16 +71,16 @@ "foreground": "#193549", "background": "#fffb38", "background_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#ff9248{{ end }}", - "{{ if and (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}#f26d50{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#f17c37{{ end }}", - "{{ if gt .Repo.Behind 0 }}#89d1dc{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#ff9248{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#f26d50{{ end }}", + "{{ if gt .Ahead 0 }}#f17c37{{ end }}", + "{{ if gt .Behind 0 }}#89d1dc{{ end }}" ], "properties": { "fetch_status": true, "fetch_stash_count": true, "fetch_upstream_icon": true, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/mt.omp.json b/themes/mt.omp.json index eeaa29f4..08cbae2c 100644 --- a/themes/mt.omp.json +++ b/themes/mt.omp.json @@ -39,7 +39,7 @@ "fetch_status": false, "fetch_upstream_icon": true, "branch_icon": "", - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}", + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}", "prefix": " \u279C (", "postfix": ") " } diff --git a/themes/negligible.omp.json b/themes/negligible.omp.json index 6df73879..b0e430b4 100644 --- a/themes/negligible.omp.json +++ b/themes/negligible.omp.json @@ -29,7 +29,7 @@ "properties": { "prefix": ":: ", "fetch_status": true, - "template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}" + "template": "{{ .HEAD }}{{ .BranchStatus }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}" } } ] diff --git a/themes/night-owl.omp.json b/themes/night-owl.omp.json index f02a71bf..7bbb7834 100644 --- a/themes/night-owl.omp.json +++ b/themes/night-owl.omp.json @@ -52,16 +52,16 @@ "foreground": "#011627", "background": "#22da6e", "background_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#ffeb95{{ end }}", - "{{ if and (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}#c5e478{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#C792EA{{ end }}", - "{{ if gt .Repo.Behind 0 }}#C792EA{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#ffeb95{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#c5e478{{ end }}", + "{{ if gt .Ahead 0 }}#C792EA{{ end }}", + "{{ if gt .Behind 0 }}#C792EA{{ end }}" ], "properties": { "branch_icon": "\ue725 ", "fetch_status": true, "fetch_upstream_icon": true, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#ef5350> \uF046 {{ .Repo.Staging.String }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}<#ef5350> \uF046 {{ .Staging.String }}{{ end }}" } }, { diff --git a/themes/nu4a.omp.json b/themes/nu4a.omp.json index a6c459f9..c842f9cc 100644 --- a/themes/nu4a.omp.json +++ b/themes/nu4a.omp.json @@ -42,7 +42,7 @@ "foreground": "#193549", "background": "#95ffa4", "properties": { - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/paradox.omp.json b/themes/paradox.omp.json index a6aa2f5f..531aacea 100644 --- a/themes/paradox.omp.json +++ b/themes/paradox.omp.json @@ -38,7 +38,7 @@ "foreground": "#193549", "background": "#95ffa4", "properties": { - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/pararussel.omp.json b/themes/pararussel.omp.json index c7b86966..3f245610 100644 --- a/themes/pararussel.omp.json +++ b/themes/pararussel.omp.json @@ -31,7 +31,7 @@ "branch_icon": "", "prefix": "<#5FAAE8>git:(", "postfix": "<#5FAAE8>)", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/patriksvensson.omp.json b/themes/patriksvensson.omp.json index 79a0fa9d..6ad82344 100644 --- a/themes/patriksvensson.omp.json +++ b/themes/patriksvensson.omp.json @@ -36,10 +36,10 @@ "style": "plain", "foreground": "green", "foreground_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}yellow{{ end }}", - "{{ if and (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}red{{ end }}", - "{{ if gt .Repo.Ahead 0 }}red{{ end }}", - "{{ if gt .Repo.Behind 0 }}green{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}yellow{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}red{{ end }}", + "{{ if gt .Ahead 0 }}red{{ end }}", + "{{ if gt .Behind 0 }}green{{ end }}" ], "properties": { "fetch_status": true, @@ -48,7 +48,7 @@ "prefix": " on ", "postfix": "", "github_icon": " ", - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/pixelrobots.omp.json b/themes/pixelrobots.omp.json index c090caf4..dfa874a0 100644 --- a/themes/pixelrobots.omp.json +++ b/themes/pixelrobots.omp.json @@ -120,16 +120,16 @@ "foreground": "#ffea00", "background": "#2f2f2f", "foreground_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#ffea00{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#2EC4B6{{ end }}", - "{{ if gt .Repo.Behind 0 }}#8A4FFF{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#ffea00{{ end }}", + "{{ if gt .Ahead 0 }}#2EC4B6{{ end }}", + "{{ if gt .Behind 0 }}#8A4FFF{{ end }}" ], "properties": { "fetch_stash_count": true, "fetch_status": true, "fetch_upstream_icon": true, "prefix": "<#ffea00>\ue0b1 ", - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }}<#E84855> \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#2FDA4E> \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }}<#E84855> \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}<#2FDA4E> \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/plague.omp.json b/themes/plague.omp.json index 8c5f4599..b75d9bb1 100644 --- a/themes/plague.omp.json +++ b/themes/plague.omp.json @@ -43,7 +43,7 @@ "properties": { "fetch_stash_count": true, "fetch_upstream_icon": true, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/powerlevel10k_classic.omp.json b/themes/powerlevel10k_classic.omp.json index c838010d..28a9dfb0 100644 --- a/themes/powerlevel10k_classic.omp.json +++ b/themes/powerlevel10k_classic.omp.json @@ -37,7 +37,7 @@ "background": "#546E7A", "properties": { "prefix": "<#26C6DA>\uE0B1 ", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/powerlevel10k_lean.omp.json b/themes/powerlevel10k_lean.omp.json index a64341b4..93a9ea7d 100644 --- a/themes/powerlevel10k_lean.omp.json +++ b/themes/powerlevel10k_lean.omp.json @@ -36,7 +36,7 @@ "foreground": "#FFE700", "properties": { "prefix": "", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/powerlevel10k_modern.omp.json b/themes/powerlevel10k_modern.omp.json index 3502e935..018f0b4c 100644 --- a/themes/powerlevel10k_modern.omp.json +++ b/themes/powerlevel10k_modern.omp.json @@ -42,7 +42,7 @@ "powerline_symbol": "\uE0B4", "properties": { "prefix": " ", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } } ] diff --git a/themes/powerlevel10k_rainbow.omp.json b/themes/powerlevel10k_rainbow.omp.json index 223a3c9e..93c1c0d9 100644 --- a/themes/powerlevel10k_rainbow.omp.json +++ b/themes/powerlevel10k_rainbow.omp.json @@ -31,17 +31,17 @@ "foreground": "#000000", "background": "#4e9a06", "background_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#c4a000{{ end }}", - "{{ if and (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}#f26d50{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#89d1dc{{ end }}", - "{{ if gt .Repo.Behind 0 }}#4e9a06{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#c4a000{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#f26d50{{ end }}", + "{{ if gt .Ahead 0 }}#89d1dc{{ end }}", + "{{ if gt .Behind 0 }}#4e9a06{{ end }}" ], "properties": { "branch_icon": "\uF126 ", "fetch_stash_count": true, "fetch_status": true, "fetch_upstream_icon": true, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } } ] diff --git a/themes/powerline.omp.json b/themes/powerline.omp.json index 000dac12..935b9453 100644 --- a/themes/powerline.omp.json +++ b/themes/powerline.omp.json @@ -32,7 +32,7 @@ "foreground": "#193549", "background": "#95ffa4", "properties": { - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/pure.omp.json b/themes/pure.omp.json index 2b5dcac4..4dcd3f64 100644 --- a/themes/pure.omp.json +++ b/themes/pure.omp.json @@ -49,7 +49,7 @@ "branch_ahead_icon": "<#88C0D0>\u21e1 ", "branch_behind_icon": "<#88C0D0>\u21e3 ", "local_working_icon": "<#FFAFD7>\u002a", - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } } ] diff --git a/themes/remk.omp.json b/themes/remk.omp.json index 64a8fdb8..6e9d77cf 100644 --- a/themes/remk.omp.json +++ b/themes/remk.omp.json @@ -35,7 +35,7 @@ "branch_icon": "", "prefix": " git(", "postfix": ") ", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/robbyrussel.omp.json b/themes/robbyrussel.omp.json index db3bdb0c..3482f715 100644 --- a/themes/robbyrussel.omp.json +++ b/themes/robbyrussel.omp.json @@ -31,7 +31,7 @@ "branch_icon": "", "prefix": "<#5FAAE8>git:(", "postfix": "<#5FAAE8>)", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/rudolfs-dark.omp.json b/themes/rudolfs-dark.omp.json index 24262089..5c382a16 100644 --- a/themes/rudolfs-dark.omp.json +++ b/themes/rudolfs-dark.omp.json @@ -59,7 +59,7 @@ "fetch_upstream_icon": true, "prefix": "[ ", "postfix": " ]", - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/rudolfs-light.omp.json b/themes/rudolfs-light.omp.json index d24ba3b6..61715576 100644 --- a/themes/rudolfs-light.omp.json +++ b/themes/rudolfs-light.omp.json @@ -40,8 +40,8 @@ "background": "#E0E0E0", "foreground": "#424242", "foreground_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#053F22{{ end }}", - "{{ if or (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}#0A703E{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#053F22{{ end }}", + "{{ if or (gt .Ahead 0) (gt .Behind 0) }}#0A703E{{ end }}" ], "properties": { "fetch_status": true, @@ -49,7 +49,7 @@ "fetch_upstream_icon": true, "prefix": " [", "postfix": "] ", - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }}<#BD6200> \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#053F22> \uF046 {{ .Repo.Staging.String }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }}<#BD6200> \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}<#053F22> \uF046 {{ .Staging.String }}{{ end }}" } }, { diff --git a/themes/slim.omp.json b/themes/slim.omp.json index 26af1e74..643ad1c8 100644 --- a/themes/slim.omp.json +++ b/themes/slim.omp.json @@ -79,16 +79,16 @@ "foreground": "#ffeb3b", "background": "#2f2f2f", "foreground_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#ffeb3b{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#2EC4B6{{ end }}", - "{{ if gt .Repo.Behind 0 }}#8A4FFF{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#ffeb3b{{ end }}", + "{{ if gt .Ahead 0 }}#2EC4B6{{ end }}", + "{{ if gt .Behind 0 }}#8A4FFF{{ end }}" ], "properties": { "fetch_stash_count": true, "fetch_status": true, "fetch_upstream_icon": true, "prefix": "<#7a7a7a>\ue0b1 ", - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }}<#E84855> \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#2FDA4E> \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }}<#E84855> \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}<#2FDA4E> \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/slimfat.omp.json b/themes/slimfat.omp.json index 75eb452f..ea5f6f91 100644 --- a/themes/slimfat.omp.json +++ b/themes/slimfat.omp.json @@ -77,16 +77,16 @@ "foreground": "#ffeb3b", "background": "#2f2f2f", "foreground_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#ffeb3b{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#2EC4B6{{ end }}", - "{{ if gt .Repo.Behind 0 }}#8A4FFF{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#ffeb3b{{ end }}", + "{{ if gt .Ahead 0 }}#2EC4B6{{ end }}", + "{{ if gt .Behind 0 }}#8A4FFF{{ end }}" ], "properties": { "fetch_stash_count": true, "fetch_status": true, "fetch_upstream_icon": true, "prefix": "<#7a7a7a>\ue0b1 ", - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }}<#E84855> \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }}<#2FDA4E> \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }}<#E84855> \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }}<#2FDA4E> \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/sorin.omp.json b/themes/sorin.omp.json index f7f3fad6..e2d33d0f 100644 --- a/themes/sorin.omp.json +++ b/themes/sorin.omp.json @@ -35,7 +35,7 @@ "foreground": "#C1C106", "properties": { "prefix": "<#ffffff>git:", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/space.omp.json b/themes/space.omp.json index 0219f852..47d975bd 100644 --- a/themes/space.omp.json +++ b/themes/space.omp.json @@ -50,7 +50,7 @@ "branch_icon": "", "fetch_stash_count": true, "prefix": "<#ffffff>on ", - "template": "{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .HEAD }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/spaceship.omp.json b/themes/spaceship.omp.json index 63299526..03ec6730 100644 --- a/themes/spaceship.omp.json +++ b/themes/spaceship.omp.json @@ -41,7 +41,7 @@ "branch_icon": " <#ff94df>", "fetch_stash_count": true, "prefix": "<#ffffff>on ", - "template": "{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .HEAD }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, diff --git a/themes/star.omp.json b/themes/star.omp.json index 7bf5a48d..c9031b77 100644 --- a/themes/star.omp.json +++ b/themes/star.omp.json @@ -31,7 +31,7 @@ "properties": { "prefix": "<#ffffff>on ", "fetch_status": true, - "template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}" + "template": "{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}" } }, { diff --git a/themes/stelbent.minimal.omp.json b/themes/stelbent.minimal.omp.json index 08812c7e..3f867dd6 100644 --- a/themes/stelbent.minimal.omp.json +++ b/themes/stelbent.minimal.omp.json @@ -69,10 +69,10 @@ "foreground": "#100e23", "background": "#95ffa4", "background_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#ff9248{{ end }}", - "{{ if and (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}#f26d50{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#89d1dc{{ end }}", - "{{ if gt .Repo.Behind 0 }}#c5b6ad{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#ff9248{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#f26d50{{ end }}", + "{{ if gt .Ahead 0 }}#89d1dc{{ end }}", + "{{ if gt .Behind 0 }}#c5b6ad{{ end }}" ], "properties": { "fetch_status": true, @@ -90,7 +90,7 @@ "no_commits_icon": "[no commits]", "rebase_icon": "\u2c62 ", "tag_icon": "\u25b6 ", - "template": "{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} \u2502{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} \u2502{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/tonybaloney.omp.json b/themes/tonybaloney.omp.json index 7fee235a..24883af3 100644 --- a/themes/tonybaloney.omp.json +++ b/themes/tonybaloney.omp.json @@ -25,7 +25,7 @@ "properties": { "fetch_stash_count": true, "fetch_upstream_icon": true, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" }, "style": "powerline", "type": "git" diff --git a/themes/unicorn.omp.json b/themes/unicorn.omp.json index a6339e14..48f125d0 100644 --- a/themes/unicorn.omp.json +++ b/themes/unicorn.omp.json @@ -41,16 +41,16 @@ "foreground": "#193549", "background": "#d2ff5e", "background_templates": [ - "{{ if or (.Repo.Working.Changed) (.Repo.Staging.Changed) }}#ff9248{{ end }}", - "{{ if and (gt .Repo.Ahead 0) (gt .Repo.Behind 0) }}#f26d50{{ end }}", - "{{ if gt .Repo.Ahead 0 }}#89d1dc{{ end }}", - "{{ if gt .Repo.Behind 0 }}#f17c37{{ end }}" + "{{ if or (.Working.Changed) (.Staging.Changed) }}#ff9248{{ end }}", + "{{ if and (gt .Ahead 0) (gt .Behind 0) }}#f26d50{{ end }}", + "{{ if gt .Ahead 0 }}#89d1dc{{ end }}", + "{{ if gt .Behind 0 }}#f17c37{{ end }}" ], "properties": { "fetch_status": true, "fetch_stash_count": true, "fetch_upstream_icon": true, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}{{ .Repo.BranchStatus }}{{ if .Repo.Working.Changed }} \uF044 {{ .Repo.Working.String }}{{ end }}{{ if and (.Repo.Working.Changed) (.Repo.Staging.Changed) }} |{{ end }}{{ if .Repo.Staging.Changed }} \uF046 {{ .Repo.Staging.String }}{{ end }}{{ if gt .Repo.StashCount 0 }} \uF692 {{ .Repo.StashCount }}{{ end }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}{{ .BranchStatus }}{{ if .Working.Changed }} \uF044 {{ .Working.String }}{{ end }}{{ if and (.Working.Changed) (.Staging.Changed) }} |{{ end }}{{ if .Staging.Changed }} \uF046 {{ .Staging.String }}{{ end }}{{ if gt .StashCount 0 }} \uF692 {{ .StashCount }}{{ end }}" } }, { diff --git a/themes/wopian.omp.json b/themes/wopian.omp.json index 1cb571b4..ba801ced 100644 --- a/themes/wopian.omp.json +++ b/themes/wopian.omp.json @@ -31,7 +31,7 @@ "properties": { "prefix": ":: git(", "postfix": ")", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } } ] diff --git a/themes/xtoys.omp.json b/themes/xtoys.omp.json index 82b398e0..422fbfc7 100644 --- a/themes/xtoys.omp.json +++ b/themes/xtoys.omp.json @@ -38,7 +38,7 @@ "prefix": "HEAD:", "branch_icon": "", "fetch_upstream_icon": false, - "template": "{{ .Repo.UpstreamIcon }}{{ .Repo.HEAD }}" + "template": "{{ .UpstreamIcon }}{{ .HEAD }}" } }, { diff --git a/themes/ys.omp.json b/themes/ys.omp.json index 504328df..69b10bfd 100644 --- a/themes/ys.omp.json +++ b/themes/ys.omp.json @@ -63,7 +63,7 @@ "style": "plain", "properties": { "prefix": "on git:", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, { diff --git a/themes/zash.omp.json b/themes/zash.omp.json index 10665873..1d1993a7 100644 --- a/themes/zash.omp.json +++ b/themes/zash.omp.json @@ -42,7 +42,7 @@ "branch_icon": "", "prefix": " <#DDB15F>git(", "postfix": "<#DDB15F>)", - "template": "{{ .Repo.HEAD }}" + "template": "{{ .HEAD }}" } }, {