File 0021-fix-slash-in-index-for-git_index_add.patch of Package libgit2.34824
--- a/src/index.c.smb 2024-07-17 14:46:21.642244728 -0400 +++ b/src/index.c 2024-07-17 14:48:04.857313431 -0400 @@ -1155,10 +1155,13 @@ size_t len, pos; for (;;) { - if (*--slash == '/') - break; + slash--; + if (slash <= entry->path) return 0; + + if (*slash == '/') + break; } len = slash - name;