Commit 7e02c7c56ac2a3dc8fce199b7b05a0bf51fa2417

Ben Straub 2012-07-31T08:45:42

Checkout: save index on checkout.

diff --git a/examples/network/clone.c b/examples/network/clone.c
index 177a4c2..b7ac0fb 100644
--- a/examples/network/clone.c
+++ b/examples/network/clone.c
@@ -38,7 +38,6 @@ int clone(git_repository *repo, int argc, char **argv)
 	pthread_t worker;
 
 	// Validate args
-	printf("argc %d\n");
 	if (argc < 3) {
 		printf("USAGE: %s <url> <path>\n", argv[0]);
 		return -1;
diff --git a/src/checkout.c b/src/checkout.c
index 87116ba..41acf1c 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -192,6 +192,7 @@ int git_checkout_head(git_repository *repo, git_checkout_opts *opts, git_indexer
 		git_index *idx;
 		if (!(retcode = git_repository_index(&idx, repo))) {
 			if (!(retcode = git_index_read_tree(idx, tree, stats))) {
+				git_index_write(idx);
 				retcode = git_tree_walk(tree, checkout_walker, GIT_TREEWALK_POST, &payload);
 			}
 			git_index_free(idx);