]> git.ipfire.org Git - thirdparty/git.git/blobdiff - sparse-index.c
The twelfth batch
[thirdparty/git.git] / sparse-index.c
index 3578feb28376e308ebb1ab1adc069c6860bbe72b..e48e40cae71f975f98f1874b90fc8889c0c710e2 100644 (file)
@@ -579,8 +579,9 @@ void expand_to_path(struct index_state *istate,
                replace++;
                temp = *replace;
                *replace = '\0';
+               substr_len = replace - path_mutable.buf;
                if (index_file_exists(istate, path_mutable.buf,
-                                     path_mutable.len, icase)) {
+                                     substr_len, icase)) {
                        /*
                         * We found a parent directory in the name-hash
                         * hashtable, because only sparse directory entries
@@ -593,7 +594,6 @@ void expand_to_path(struct index_state *istate,
                }
 
                *replace = temp;
-               substr_len = replace - path_mutable.buf;
        }
 
 cleanup: