From: Junio C Hamano Date: Mon, 16 Jun 2014 17:06:15 +0000 (-0700) Subject: Merge branch 'jk/report-fail-to-read-objects-better' X-Git-Tag: v2.1.0-rc0~129 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/9d1d882e9c1d4a34e2ae3af47d50c1f115a6cf84 Merge branch 'jk/report-fail-to-read-objects-better' * jk/report-fail-to-read-objects-better: open_sha1_file: report "most interesting" errno --- 9d1d882e9c1d4a34e2ae3af47d50c1f115a6cf84 diff --cc sha1_file.c index 3e9f55f1bb,1e1edf4b25..34d527f670 --- a/sha1_file.c +++ b/sha1_file.c @@@ -1436,16 -1422,19 +1436,17 @@@ static int stat_sha1_file(const unsigne static int open_sha1_file(const unsigned char *sha1) { int fd; - char *name = sha1_file_name(sha1); struct alternate_object_database *alt; + int most_interesting_errno; - fd = git_open_noatime(name); + fd = git_open_noatime(sha1_file_name(sha1)); if (fd >= 0) return fd; + most_interesting_errno = errno; prepare_alt_odb(); - errno = ENOENT; for (alt = alt_odb_list; alt; alt = alt->next) { - name = alt->name; - fill_sha1_path(name, sha1); + fill_sha1_path(alt->name, sha1); fd = git_open_noatime(alt->base); if (fd >= 0) return fd;