X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=local-fetch.c;h=87a93de02f759f544ebfd1d6fb584886f483fbfc;hb=1f5881bb5f4da97d0bb23024ae91079137326c7e;hp=0dbed8910bbc3aa570c512eff893a4c603fdb5f7;hpb=628cd5430fdf71a75c02af88ab7b557d29687db5;p=git.git diff --git a/local-fetch.c b/local-fetch.c index 0dbed891..87a93de0 100644 --- a/local-fetch.c +++ b/local-fetch.c @@ -166,7 +166,10 @@ static int fetch_file(const unsigned char *sha1) int fetch(unsigned char *sha1) { - return fetch_file(sha1) && fetch_pack(sha1); + if (has_sha1_file(sha1)) + return 0; + else + return fetch_file(sha1) && fetch_pack(sha1); } int fetch_ref(char *ref, unsigned char *sha1) @@ -231,6 +234,8 @@ int main(int argc, char **argv) get_verbosely = 1; else if (argv[arg][1] == 'w') write_ref = argv[++arg]; + else if (!strcmp(argv[arg], "--recover")) + get_recover = 1; else usage(local_pull_usage); arg++;