瀏覽代碼

clean up CurrentUser global cfg logic

pull/36/head
Rob Loranger 4 年之前
父節點
當前提交
024b7090ac
沒有發現已知的金鑰在資料庫的簽署中 GPG Key ID: D6F1633A4F0903B8
共有 1 個文件被更改,包括 2 次插入3 次删除
  1. +2
    -3
      config/user.go

+ 2
- 3
config/user.go 查看文件

@@ -159,11 +159,10 @@ func CurrentUser(c *cli.Context) (string, error) {
if err != nil {
return "", err
}
// only user global defaults when both are set and hosts match
// only use global defaults when both are set and no host flag
if globalCFG.Default.User != "" &&
globalCFG.Default.Host != "" &&
c.GlobalIsSet("host") &&
globalCFG.Default.Host == c.GlobalString("host") {
!c.GlobalIsSet("host") {
cfg = globalCFG
}
}


Loading…
取消
儲存