Skip to content

Commit

Permalink
[PATCH] Implement --recover for git-*-fetch
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
iabervon authored and Junio C Hamano committed Sep 27, 2005
1 parent 5da1606 commit 820eca6
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions fetch.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);

Expand Down
2 changes: 2 additions & 0 deletions http-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down
2 changes: 2 additions & 0 deletions local-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
Expand Down
2 changes: 2 additions & 0 deletions ssh-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++;
}
Expand Down

0 comments on commit 820eca6

Please sign in to comment.