From e3f073b1e154f44c1e1c7716a2ed6977dd144224 Mon Sep 17 00:00:00 2001
From: Ray Donnelly <mingw.android@gmail.com>
Date: Thu, 8 Oct 2015 17:10:28 +0100
Subject: [PATCH 1/2] normalize_path_copy: NEEDSWORK for trailing '/'

Currently, normalize_path_copy () does nothing regarding trailing '/'s.
Instead it should remove them except in the case of the root folder.
---
 path.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/path.c b/path.c
index 65beb2d..4ae6db6 100644
--- a/path.c
+++ b/path.c
@@ -893,6 +893,11 @@ const char *remove_leading_path(const char *in, const char *prefix)
  * normalized, any time "../" eats up to the prefix_len part,
  * prefix_len is reduced. In the end prefix_len is the remaining
  * prefix that has not been overridden by user pathspec.
+ *
+ * NEEDSWORK: This function doesn't perform normalization w.r.t. trailing '/'.
+ * For everything but the root folder itself, the normalized path should not
+ * end with a '/', then the callers need to be fixed up accordingly.
+ *
  */
 int normalize_path_copy_len(char *dst, const char *src, int *prefix_len)
 {
-- 
2.6.1

