From 786a935264098c6d8ba6cf0bfdeb88a0a5369994 Mon Sep 17 00:00:00 2001 From: Whitney Schmidt Date: Mon, 23 Nov 2020 14:25:41 -0500 Subject: [PATCH] fix inconsistency in error message for windows system invalid file names when creating a new branch Signed-off-by: Whitney Schmidt --- refs.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/refs.c b/refs.c index 3ad862a0a52cb1..2129ac7920775c 100644 --- a/refs.c +++ b/refs.c @@ -167,6 +167,9 @@ static int check_or_sanitize_refname(const char *refname, int flags, { int component_len, component_count = 0; + if (!is_valid_path(refname)) + return -1; + if (!strcmp(refname, "@")) { /* Refname is a single character '@'. */ if (sanitized)