commit - f9f627c50558e4f15df222bfeeeb5c960d527d70
commit + 370f10653490c6d8f3e587869c96c100535edc9f
blob - 40eb28c29c7042a0646e6597df2942339b5ebd48
blob + b58b9970c4f4924c6663e2de3b426bcf71082141
--- lib/object.c
+++ lib/object.c
return err;
*fd = open(path, O_RDONLY | O_NOFOLLOW | O_CLOEXEC);
if (*fd == -1) {
- err = got_error_from_errno2("open", path);
+ if (errno == ENOENT)
+ err = got_error_no_obj(id);
+ else
+ err = got_error_from_errno2("open", path);
goto done;
}
done:
blob - 6d3cc02388107ba9636418a37dd0a10e66670f94
blob + 7295b46f06c77398115aafdfe70c3523fdbc5d71
--- lib/object_open_io.c
+++ lib/object_open_io.c
return NULL;
err = got_object_open_loose_fd(&fd, id, repo);
- if (err) {
- if (err->code == GOT_ERR_ERRNO && errno == ENOENT)
- err = got_error_no_obj(id);
+ if (err)
return err;
- }
err = got_object_read_header(obj, fd);
if (err)
blob - 5e65af8b44e92ed67e01cb75e6067361e2495821
blob + e7520800792bf32be7c1cc4480dd40aeedfaed96
--- lib/object_open_privsep.c
+++ lib/object_open_privsep.c
}
err = got_object_open_loose_fd(&fd, id, repo);
- if (err) {
- if (err->code == GOT_ERR_ERRNO && errno == ENOENT)
- err = got_error_no_obj(id);
+ if (err)
return err;
- }
err = got_object_read_header_privsep(obj, id, repo, fd);
if (err)
blob - 1b2025992be4d03420f106db1af5777b5bb84907
blob + 6f82982ad2e1d53c37ba2de0a2ebfaca01a77193
--- regress/cmdline/tree.sh
+++ regress/cmdline/tree.sh
local submodule_id=$(got tree -r $testroot/repo -i | \
grep 'repo2\$$' | cut -d ' ' -f1)
- local objpath=`get_loose_object_path $testroot/repo $submodule_id`
- # Currently fails in open(2)
got tree -r $testroot/repo repo2 > $testroot/stdout 2> $testroot/stderr
ret=$?
if [ $ret -eq 0 ]; then
test_done "$testroot" "1"
return 1
fi
- echo "got: open: $objpath: No such file or directory" \
- > $testroot/stderr.expected
+ echo "got: object $submodule_id not found" > $testroot/stderr.expected
cmp -s $testroot/stderr.expected $testroot/stderr
ret=$?