diff options
author | Daniel Barkalow <barkalow@iabervon.org> | 2005-09-27 05:38:08 +0400 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-09-27 11:16:40 +0400 |
commit | 820eca68c2577d7499d203d7f4f7ae479b577683 (patch) | |
tree | 09467cba8cb0224fd9e3859988b116b0be8f5381 | |
parent | 5da1606d0bf5b970fadfa0ca91618a1e871f6755 (diff) |
[PATCH] Implement --recover for git-*-fetch
With the --recover option, we verify that we have absolutely
everything reachable from the target, not assuming that things
reachable from refs will be complete.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r-- | fetch.c | 5 | ||||
-rw-r--r-- | fetch.h | 3 | ||||
-rw-r--r-- | http-fetch.c | 2 | ||||
-rw-r--r-- | local-fetch.c | 2 | ||||
-rw-r--r-- | ssh-fetch.c | 2 |
5 files changed, 13 insertions, 1 deletions
@@ -15,6 +15,7 @@ int get_tree = 0; int get_history = 0; int get_all = 0; int get_verbosely = 0; +int get_recover = 0; static unsigned char current_commit_sha1[20]; void pull_say(const char *fmt, const char *hex) @@ -214,7 +215,9 @@ int pull(char *target) return -1; } - for_each_ref(mark_complete); + if (!get_recover) { + for_each_ref(mark_complete); + } if (interpret_target(target, sha1)) return error("Could not interpret %s as something to pull", @@ -40,6 +40,9 @@ extern int get_all; /* Set to be verbose */ extern int get_verbosely; +/* Set to check on all reachable objects. */ +extern int get_recover; + /* Report what we got under get_verbosely */ extern void pull_say(const char *, const char *); diff --git a/http-fetch.c b/http-fetch.c index 57141a8a29..e6181b0ee6 100644 --- a/http-fetch.c +++ b/http-fetch.c @@ -491,6 +491,8 @@ int main(int argc, char **argv) } else if (argv[arg][1] == 'w') { write_ref = argv[arg + 1]; arg++; + } else if (!strcmp(argv[arg], "--recover")) { + get_recover = 1; } arg++; } diff --git a/local-fetch.c b/local-fetch.c index 0dbed8910b..a57386ca6a 100644 --- a/local-fetch.c +++ b/local-fetch.c @@ -231,6 +231,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++; diff --git a/ssh-fetch.c b/ssh-fetch.c index 683a1e4a01..05d3e49f25 100644 --- a/ssh-fetch.c +++ b/ssh-fetch.c @@ -119,6 +119,8 @@ int main(int argc, char **argv) } else if (argv[arg][1] == 'w') { write_ref = argv[arg + 1]; arg++; + } else if (!strcmp(argv[arg], "--recover")) { + get_recover = 1; } arg++; } |