diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-07-09 09:42:02 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-07-09 09:42:02 -0700 |
commit | 7db02b3bef2459b60e021369360f7a2f9e7f0c25 (patch) | |
tree | 4dae9327b9a3dec260312ba4d965c3657c50c6ca | |
parent | fe8b77b7083253e55138a2aa09b60e7f7918a081 (diff) | |
download | git-rs/sha1-file-micro-optim.tar.gz |
SQUASH???rs/sha1-file-micro-optim
-rw-r--r-- | sha1_file.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sha1_file.c b/sha1_file.c index 6a9deb9e68..d277b32bf1 100644 --- a/sha1_file.c +++ b/sha1_file.c @@ -3749,7 +3749,7 @@ int for_each_file_in_obj_subdir(unsigned int subdir_nr, each_loose_subdir_fn subdir_cb, void *data) { - size_t origlen, dirlen, baselen; + size_t origlen, baselen; DIR *dir; struct dirent *de; int r = 0; @@ -3760,7 +3760,6 @@ int for_each_file_in_obj_subdir(unsigned int subdir_nr, origlen = path->len; strbuf_complete(path, '/'); strbuf_addf(path, "%02x", subdir_nr); - dirlen = path->len; dir = opendir(path->buf); if (!dir) { @@ -3804,7 +3803,7 @@ int for_each_file_in_obj_subdir(unsigned int subdir_nr, } closedir(dir); - strbuf_setlen(path, dirlen); + strbuf_setlen(path, baselen - 1); /* chomp the '/' that we added */ if (!r && subdir_cb) r = subdir_cb(subdir_nr, path->buf, data); |