commit - 238050ce7b9ba6527d21b357cea92a51d94d39cc
commit + a3599220a642dcd27bacb8def35d06dd79ca3795
blob - d60df001bcb7f20216fb03d0e53bde49d64c0f5a
blob + bff284faf906f806e14b3b54a5308cd8dcb7f99b
--- lib/repository.c
+++ lib/repository.c
if (err) {
free(*id);
*id = NULL;
- } else if (*id == NULL)
- err = got_error_path(id_str_prefix, GOT_ERR_NO_OBJ);
+ } else if (*id == NULL) {
+ switch (obj_type) {
+ case GOT_OBJ_TYPE_BLOB:
+ err = got_error_fmt(GOT_ERR_NO_OBJ, "%s %s",
+ GOT_OBJ_LABEL_BLOB, id_str_prefix);
+ break;
+ case GOT_OBJ_TYPE_TREE:
+ err = got_error_fmt(GOT_ERR_NO_OBJ, "%s %s",
+ GOT_OBJ_LABEL_TREE, id_str_prefix);
+ break;
+ case GOT_OBJ_TYPE_COMMIT:
+ err = got_error_fmt(GOT_ERR_NO_OBJ, "%s %s",
+ GOT_OBJ_LABEL_COMMIT, id_str_prefix);
+ break;
+ case GOT_OBJ_TYPE_TAG:
+ err = got_error_fmt(GOT_ERR_NO_OBJ, "%s %s",
+ GOT_OBJ_LABEL_TAG, id_str_prefix);
+ break;
+ default:
+ err = got_error_path(id_str_prefix, GOT_ERR_NO_OBJ);
+ break;
+ }
+ }
return err;
}
}
if (err == NULL && *tag == NULL)
- err = got_error_path(name, GOT_ERR_NO_OBJ);
+ err = got_error_fmt(GOT_ERR_NO_OBJ, "%s %s",
+ GOT_OBJ_LABEL_TAG, name);
return err;
}
blob - f4f0029ca41073b2b76c6a560ab229e160f04d55
blob + fb11f286780b130bb30e7694ace57e52e5548050
--- regress/cmdline/log.sh
+++ regress/cmdline/log.sh
return 1
fi
echo -n > $testroot/stdout.expected
- echo "got: $empty_sha1: object not found" > $testroot/stderr.expected
+ echo "got: commit $empty_sha1: object not found" \
+ > $testroot/stderr.expected
cmp -s $testroot/stderr.expected $testroot/stderr
ret="$?"
if [ "$ret" != "0" ]; then
blob - 2e90851555c6dbe52c187b1f339b87326b87ad22
blob + c8859f46c8278cf558c597f855aa02630021aa69
--- regress/cmdline/tag.sh
+++ regress/cmdline/tag.sh
return 1
fi
- echo "got: $tree_id: object not found" > $testroot/stderr.expected
+ echo "got: commit $tree_id: object not found" \
+ > $testroot/stderr.expected
cmp -s $testroot/stderr $testroot/stderr.expected
ret="$?"
if [ "$ret" != "0" ]; then