Make sure we do not write bogus reflog entries.
The file format dictates that entries are LF terminated so the message cannot have one in it. Chomp the message to make sure it only has a single line if necessary, while removing the leading whitespace. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
@ -23,8 +23,6 @@ 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])) {
|
||||
|
||||
Reference in New Issue
Block a user