public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* [PATCH 1/2] test-path-utils.c: remove incorrect assumption
@ 2015-10-03 12:44 Ray Donnelly
  2015-10-03 15:38 ` Ray Donnelly
  2015-10-03 17:13 ` Junio C Hamano
  0 siblings, 2 replies; 9+ messages in thread
From: Ray Donnelly @ 2015-10-03 12:44 UTC (permalink / raw)
  To: git; +Cc: Johannes Schindelin, Ray Donnelly

In normalize_ceiling_entry(), we test that normalized paths end with
slash, *unless* the path to be normalized was already the root
directory.

However, normalize_path_copy() does not even enforce this condition.

Even worse: on Windows, the root directory gets translated into a
Windows directory by the Bash before being passed to `git.exe` (or
`test-path-utils.exe`), which means that we cannot even know whether
the path that was passed to us was the root directory to begin with.

This issue has already caused endless hours of trying to "fix" the
MSYS2 runtime, only to break other things due to MSYS2 ensuring that
the converted path maintains the same state as the input path with
respect to any final '/'.

So let's just forget about this test. It is non-essential to Git's
operation, anyway.

Ack-by: Johannes Schindelin <johannes.schindelin@gmx•de>
Signed-off-by: Ray Donnelly <mingw.android@gmail•com>
---
 test-path-utils.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/test-path-utils.c b/test-path-utils.c
index 3dd3744..c67bf65 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;
-- 
2.5.2

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-10-09 10:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-03 12:44 [PATCH 1/2] test-path-utils.c: remove incorrect assumption Ray Donnelly
2015-10-03 15:38 ` Ray Donnelly
2015-10-03 17:13 ` Junio C Hamano
2015-10-04 14:51   ` Ray Donnelly
2015-10-04 17:21     ` Junio C Hamano
2015-10-04 23:36       ` Ray Donnelly
2015-10-08 20:42         ` Ray Donnelly
2015-10-09  1:05           ` Junio C Hamano
2015-10-09 10:12             ` Ray Donnelly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox