commit - 37de562ead5a95ca95e8779e7a8e218876166ff7
commit + 2f46ecd27c3d285e0a82670ff8dc042db5e58d5d
blob - e93728385f32d4085286df2430149d36ac1a6af1
blob + 80379bddab5170afe5c0e8cbb9bd21f4d8362982
--- got/got.c
+++ got/got.c
const char *jumphost = NULL, *identity_file = NULL;
int verbosity = 0, fetch_all_branches = 0, mirror_references = 0;
int bflag = 0, list_refs_only = 0;
- int *pack_fds = NULL;
+ int *pack_fds = NULL, have_head_ref = 0;
RB_INIT(&refs);
RB_INIT(&symrefs);
got_ref_close(target_ref);
if (error)
goto done;
+ have_head_ref = 1;
if (mirror_references)
continue;
if (error)
goto done;
}
- if (pe == NULL) {
+ if (!have_head_ref) {
/*
* We failed to set the HEAD reference. If we asked for
* a set of wanted branches use the first of one of those
got_ref_close(target_ref);
if (error)
goto done;
+ have_head_ref = 1;
break;
}
* If we have no HEAD ref yet, set it to the first branch
* which was fetched.
*/
- if (pe == NULL) {
+ if (!have_head_ref) {
RB_FOREACH(pe, got_pathlist_head, &refs) {
const char *refname = pe->path;
struct got_reference *target_ref;