Use Exit() instead of Panic() for validation

This commit is contained in:
Steve Streeting 2015-10-07 09:13:20 +01:00
parent 1997c7479f
commit 6ec4b57ed3

@ -29,14 +29,14 @@ func fetchCommand(cmd *cobra.Command, args []string) {
if len(args) > 0 {
// Remote is first arg
if err := git.ValidateRemote(args[0]); err != nil {
Panic(err, fmt.Sprintf("Invalid remote name '%v'", args[0]))
Exit("Invalid remote name %q", args[0])
}
lfs.Config.CurrentRemote = args[0]
} else {
// Actively find the default remote, don't just assume origin
defaultRemote, err := git.DefaultRemote()
if err != nil {
Panic(err, "No default remote")
Exit("No default remote")
}
lfs.Config.CurrentRemote = defaultRemote
}