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) {
|
||||
lfs.ShowConfigWarnings = true
|
||||
config := lfs.Config
|
||||
endpoint := config.Endpoint()
|
||||
|
||||
|
@ -16,8 +16,9 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
Config = NewConfig()
|
||||
defaultRemote = "origin"
|
||||
Config = NewConfig()
|
||||
defaultRemote = "origin"
|
||||
ShowConfigWarnings = false
|
||||
)
|
||||
|
||||
// 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) {
|
||||
newIndex := filenameIndex + 1
|
||||
if len(filenames) > newIndex {
|
||||
expected := ".lfsconfig"
|
||||
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)
|
||||
if ShowConfigWarnings {
|
||||
expected := ".lfsconfig"
|
||||
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)
|
||||
}
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user