Checkout: save index on checkout.

This commit is contained in:
Ben Straub 2012-07-31 08:45:42 -07:00
parent 4bf5115642
commit 7e02c7c56a
2 changed files with 1 additions and 1 deletions

View File

@ -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;

View File

@ -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);