only show the warning for 'git lfs env'
This commit is contained in:
parent
3ce5770cba
commit
265feee819
@ -14,6 +14,7 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func envCommand(cmd *cobra.Command, args []string) {
|
func envCommand(cmd *cobra.Command, args []string) {
|
||||||
|
lfs.ShowConfigWarnings = true
|
||||||
config := lfs.Config
|
config := lfs.Config
|
||||||
endpoint := config.Endpoint()
|
endpoint := config.Endpoint()
|
||||||
|
|
||||||
|
@ -16,8 +16,9 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
Config = NewConfig()
|
Config = NewConfig()
|
||||||
defaultRemote = "origin"
|
defaultRemote = "origin"
|
||||||
|
ShowConfigWarnings = false
|
||||||
)
|
)
|
||||||
|
|
||||||
// FetchPruneConfig collects together the config options that control fetching and pruning
|
// FetchPruneConfig collects together the config options that control fetching and pruning
|
||||||
@ -370,9 +371,11 @@ func (c *Configuration) readGitConfigFromFiles(filenames []string, filenameIndex
|
|||||||
if os.IsNotExist(err) {
|
if os.IsNotExist(err) {
|
||||||
newIndex := filenameIndex + 1
|
newIndex := filenameIndex + 1
|
||||||
if len(filenames) > newIndex {
|
if len(filenames) > newIndex {
|
||||||
expected := ".lfsconfig"
|
if ShowConfigWarnings {
|
||||||
fmt.Fprintf(os.Stderr, "WARNING: Reading LFS config from %q, not %q. Rename to %q before Git LFS v2.0 to remove this warning.\n",
|
expected := ".lfsconfig"
|
||||||
filepath.Base(filenames[newIndex]), expected, expected)
|
fmt.Fprintf(os.Stderr, "WARNING: Reading LFS config from %q, not %q. Rename to %q before Git LFS v2.0 to remove this warning.\n",
|
||||||
|
filepath.Base(filenames[newIndex]), expected, expected)
|
||||||
|
}
|
||||||
c.readGitConfigFromFiles(filenames, newIndex, uniqRemotes)
|
c.readGitConfigFromFiles(filenames, newIndex, uniqRemotes)
|
||||||
}
|
}
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user