add: check return value of launch_editor
[gitweb.git] / builtin / add.c
index 459208a326cd4cebfa813168d81a06c27fc54fc5..1c7436589e3b44356da9eb319ddc6d75e38f9b68 100644 (file)
@@ -207,7 +207,8 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
        if (run_diff_files(&rev, 0))
                die(_("Could not write patch"));
 
-       launch_editor(file, NULL, NULL);
+       if (launch_editor(file, NULL, NULL))
+               die(_("editing patch failed"));
 
        if (stat(file, &st))
                die_errno(_("Could not stat '%s'"), file);