Fix minor bugs Fixed no-submodule speedup of new checkout code. Fixed missing final update to progress (which may go away, I realize). Fixed unused structure in header and incorrect comment.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
diff --git a/src/checkout.c b/src/checkout.c
index 74ac379..4782f77 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -243,7 +243,8 @@ static int checkout_create_the_new(
if (do_checkout) {
bool is_submodule = S_ISGITLINK(delta->old_file.mode);
- data->found_submodules = true;
+ if (is_submodule)
+ data->found_submodules = true;
if (!is_submodule && !data->create_submodules)
error = checkout_blob(data, &delta->old_file);
@@ -377,6 +378,8 @@ int git_checkout_index(
diff, &data, checkout_create_the_new, NULL, NULL);
}
+ stats->processed = stats->total;
+
cleanup:
if (error == GIT_EUSER)
error = (data.error != 0) ? data.error : -1;
diff --git a/src/diff.h b/src/diff.h
index 15745b2..c6a26ae 100644
--- a/src/diff.h
+++ b/src/diff.h
@@ -28,17 +28,12 @@ enum {
GIT_DIFFCAPS_USE_DEV = (1 << 4), /* use st_dev? */
};
-typedef struct {
- git_refcount rc;
- git_diff_delta delta;
-} git_diff_delta_refcounted;
-
struct git_diff_list {
git_refcount rc;
git_repository *repo;
git_diff_options opts;
git_vector pathspec;
- git_vector deltas; /* vector of git_diff_delta_refcounted */
+ git_vector deltas; /* vector of git_diff_delta */
git_pool pool;
git_iterator_type_t old_src;
git_iterator_type_t new_src;