fix overstrict :<path> diagnosis
[gitweb.git] / sha1_name.c
index faea58dc8c27de23e8fbaff17b39cb9e57708510..90d8bfa20a153a97dcb3f7a974d9b4b457c02f79 100644 (file)
@@ -1173,7 +1173,7 @@ int get_sha1_with_context_1(const char *name, unsigned char *sha1,
                        }
                        pos++;
                }
-               if (!gently)
+               if (!gently && name[1] && name[1] != '/')
                        diagnose_invalid_index_path(stage, prefix, cp);
                free(new_path);
                return -1;