diff --git a/src/diff.c b/src/diff.c index 375520e04..7a0051ae3 100644 --- a/src/diff.c +++ b/src/diff.c @@ -448,7 +448,11 @@ static int oid_for_workdir_item( return -1; /* calculate OID for file if possible*/ - if (S_ISLNK(item->mode)) + if (S_ISGITLINK(item->mode)) { + /* Don't bother to figure out an oid for a submodule. We won't use it anyway. */ + memset(oid, 0, sizeof(*oid)); + result = 0; + } else if (S_ISLNK(item->mode)) result = git_odb__hashlink(oid, full_path.ptr); else if (!git__is_sizet(item->file_size)) { giterr_set(GITERR_OS, "File size overflow for 32-bit systems");