commit - 55ff12a650e3bd5e4a81811caf98904a627c59e3
commit + ec9e97005c78048a84eebd1889f6d149c337ac8e
blob - 78332997dbcd1bbcf19dda1a4540702bf27094d6
blob + da9cdaf407efe99157bcb838eb9d52d7b9de8ae9
--- libexec/got-fetch-pack/got-fetch-pack.c
+++ libexec/got-fetch-pack/got-fetch-pack.c
continue;
default_branch = symref_target;
break;
- }
- if (default_branch == NULL) {
- default_id_str = strdup(id_str);
- if (default_id_str == NULL) {
- err = got_error_from_errno(
- "strdup");
- goto done;
- }
}
}
if (default_branch)
getprogname(), refname);
}
continue;
+ }
+ if (default_branch == NULL &&
+ strcmp(refname, GOT_REF_HEAD) == 0) {
+ default_id_str = strdup(id_str);
+ if (default_id_str == NULL) {
+ err = got_error_from_errno("strdup");
+ goto done;
+ }
}
if (default_branch && default_id_str == NULL &&
strcmp(refname, default_branch) == 0) {