mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-29 04:49:39 -08:00
parent
0b0f119420
commit
dc851fcf53
|
@ -518,6 +518,11 @@ func (g *Git) getOriginURL(upstream string) string {
|
||||||
func (g *Git) getUntrackedFilesMode() string {
|
func (g *Git) getUntrackedFilesMode() string {
|
||||||
mode := "normal"
|
mode := "normal"
|
||||||
repoModes := g.props.GetKeyValueMap(UntrackedModes, map[string]string{})
|
repoModes := g.props.GetKeyValueMap(UntrackedModes, map[string]string{})
|
||||||
|
// make use of a wildcard for all repo's
|
||||||
|
if val := repoModes["*"]; len(val) != 0 {
|
||||||
|
mode = val
|
||||||
|
}
|
||||||
|
// get the specific repo mode
|
||||||
if val := repoModes[g.realFolder]; len(val) != 0 {
|
if val := repoModes[g.realFolder]; len(val) != 0 {
|
||||||
mode = val
|
mode = val
|
||||||
}
|
}
|
||||||
|
|
|
@ -788,6 +788,13 @@ func TestGitUntrackedMode(t *testing.T) {
|
||||||
"bar": "normal",
|
"bar": "normal",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Case: "Global mode",
|
||||||
|
Expected: "-uno",
|
||||||
|
UntrackedModes: map[string]string{
|
||||||
|
"*": "no",
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
|
|
|
@ -67,7 +67,8 @@ You can set the following properties to `true` to enable fetching additional inf
|
||||||
- fetch_worktree_count: `boolean` fetch worktree count - defaults to `false`
|
- fetch_worktree_count: `boolean` fetch worktree count - defaults to `false`
|
||||||
- fetch_upstream_icon: `boolean` - fetch upstream icon - defaults to `false`
|
- fetch_upstream_icon: `boolean` - fetch upstream icon - defaults to `false`
|
||||||
- untracked_modes: `map[string]string` - map of repo's where to override the default untracked mode (`no` | `normal` | `all`). For example
|
- untracked_modes: `map[string]string` - map of repo's where to override the default untracked mode (`no` | `normal` | `all`). For example
|
||||||
`"untracked_modes": { "/Users/me/repos/repo1": "no" }` - defaults to `normal` for all repo's
|
`"untracked_modes": { "/Users/me/repos/repo1": "no" }` - defaults to `normal` for all repo's. If you want to override for all repo's, use
|
||||||
|
`*` to set the mode instead of the repo path.
|
||||||
|
|
||||||
### Icons
|
### Icons
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue