summaryrefslogtreecommitdiff
path: root/src/iterator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/iterator.c b/src/iterator.c
index cc15b5f67..001bee7b0 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -427,7 +427,12 @@ static int workdir_iterator__update_entry(workdir_iterator *wi)
/* detect submodules */
if (S_ISDIR(wi->entry.mode) &&
git_path_contains(&wi->path, DOT_GIT) == true)
+ {
+ size_t len = strlen(wi->entry.path);
+ assert(wi->entry.path[len - 1] == '/');
+ wi->entry.path[len - 1] = '\0';
wi->entry.mode = S_IFGITLINK;
+ }
return 0;
}