From 6ec4b57ed3dbe56d450d39bad177383691be9237 Mon Sep 17 00:00:00 2001 From: Steve Streeting Date: Wed, 7 Oct 2015 09:13:20 +0100 Subject: [PATCH] Use Exit() instead of Panic() for validation --- commands/command_fetch.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/command_fetch.go b/commands/command_fetch.go index aa910bb0..97b1dc8c 100644 --- a/commands/command_fetch.go +++ b/commands/command_fetch.go @@ -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 }