From 5c57f1cb4af11ba3573976c3a268fab2d6232af5 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 --- 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)