From 18f5c1632f51b7f7172441651b13ac267b421df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Mur=C3=A9?= Date: Wed, 26 Sep 2018 16:28:57 +0200 Subject: [PATCH] commands: detect when an edit title doesn't change it and abort the operation --- commands/title_edit.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands/title_edit.go b/commands/title_edit.go index 9d37dc5ccb38ce1f366c16392ab3e7f52ade520b..2d824383ce402896a0e5c3acfa7f7b4ea18eaba9 100644 --- a/commands/title_edit.go +++ b/commands/title_edit.go @@ -38,6 +38,10 @@ func runTitleEdit(cmd *cobra.Command, args []string) error { } } + if titleEditTitle == snap.Title { + fmt.Println("No change, aborting.") + } + err = b.SetTitle(titleEditTitle) if err != nil { return err