git-push through git protocol
[gitweb.git] / builtin-update-ref.c
index f2506fa9762bd9d868076710f38dfc9137186828..1461937cb987ec18a0b91e7c1084063c7174f3ae 100644 (file)
@@ -13,7 +13,6 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix)
        int i, delete;
 
        delete = 0;
-       setup_ident();
        git_config(git_default_config);
 
        for (i = 1; i < argc; i++) {
@@ -23,6 +22,8 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix)
                        msg = argv[++i];
                        if (!*msg)
                                die("Refusing to perform update with empty message.");
+                       if (strchr(msg, '\n'))
+                               die("Refusing to perform update with \\n in message.");
                        continue;
                }
                if (!strcmp("-d", argv[i])) {