@@ -106,6 +106,7 @@ int cmd_main(int argc, const char **argv)
int nongit;
struct object_id packfile_hash;
struct strvec index_pack_args = STRVEC_INIT;
+ int ret;
setup_git_directory_gently(&nongit);
@@ -157,8 +158,8 @@ int cmd_main(int argc, const char **argv)
fetch_single_packfile(&packfile_hash, argv[arg],
index_pack_args.v);
-
- return 0;
+ ret = 0;
+ goto out;
}
if (index_pack_args.nr)
@@ -170,7 +171,12 @@ int cmd_main(int argc, const char **argv)
commit_id = (char **) &argv[arg++];
commits = 1;
}
- return fetch_using_walker(argv[arg], get_verbosely, get_recover,
- commits, commit_id, write_ref,
- commits_on_stdin);
+
+ ret = fetch_using_walker(argv[arg], get_verbosely, get_recover,
+ commits, commit_id, write_ref,
+ commits_on_stdin);
+
+out:
+ strvec_clear(&index_pack_args);
+ return ret;
}