commit - a808cfa5a739af830d2426a0fa3b420425d0037b
commit + 30c0868d39a478a260b1a028088d633785bf6da1
blob - 8cf17a7dc99101cfd244574281974a3b86e0d666
blob + 1d64acc3e5b59aa53a4c744828a2b66f11618e57
--- lib/reference.c
+++ lib/reference.c
char *symref_ref;
if (line[0] == '\0')
- return got_error(GOT_ERR_NOT_REF);
+ return got_error(GOT_ERR_BAD_REF_DATA);
symref_name = strdup(name);
if (symref_name == NULL)
return got_error_from_errno();
if (!got_parse_sha1_digest(digest, line))
- return got_error(GOT_ERR_NOT_REF);
+ return got_error(GOT_ERR_BAD_REF_DATA);
*ref = calloc(1, sizeof(**ref));
if (*ref == NULL)
const char delim[3] = {'\0', '\0', '\0'};
if (f == NULL)
- return got_error(GOT_ERR_NOT_REF);
+ return got_error_not_ref(name);
line = fparseln(f, &len, NULL, delim, 0);
if (line == NULL) {
- err = got_error(GOT_ERR_NOT_REF);
+ err = got_error(GOT_ERR_BAD_REF_DATA);
goto done;
}
return NULL;
if (!got_parse_sha1_digest(digest, line))
- return got_error(GOT_ERR_NOT_REF);
+ return got_error(GOT_ERR_BAD_REF_DATA);
if (abs_refname) {
if (strcmp(line + SHA1_DIGEST_STRING_LENGTH, abs_refname) != 0)
do {
line = fparseln(f, &len, NULL, delim, 0);
if (line == NULL) {
- err = got_error(GOT_ERR_NOT_REF);
+ err = got_error_not_ref(refname);
break;
}
for (i = 0; i < nsubdirs; i++) {
normpath = got_path_normalize(path_ref);
if (normpath == NULL) {
- err = got_error(GOT_ERR_NOT_REF);
+ err = got_error_from_errno();
goto done;
}