Commit 52a61bb8047f431bf363bd9327d0f34884437c83

Russell Belfer 2012-10-17T14:10:23

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.

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;