summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--path.c5
-rw-r--r--test-path-utils.c2
2 files changed, 5 insertions, 2 deletions
diff --git a/path.c b/path.c
index 95acbafa68..58d5620b98 100644
--- a/path.c
+++ b/path.c
@@ -676,6 +676,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)
{
diff --git a/test-path-utils.c b/test-path-utils.c
index 3dd3744a57..c67bf65b34 100644
--- a/test-path-utils.c
+++ b/test-path-utils.c
@@ -21,8 +21,6 @@ static int normalize_ceiling_entry(struct string_list_item *item, void *unused)
if (normalize_path_copy(buf, ceil) < 0)
die("Path \"%s\" could not be normalized", ceil);
len = strlen(buf);
- if (len > 1 && buf[len-1] == '/')
- die("Normalized path \"%s\" ended with slash", buf);
free(item->string);
item->string = xstrdup(buf);
return 1;