Thread (61 messages) flat view 61 messages, 2 authors, 2016-06-15

Re: [PATCH v18 14/48] refs.c: log_ref_write should try to return meaningful errno

From: Ronnie Sahlberg <hidden>
Date: 2016-06-15 23:01:41

On Wed, Jun 18, 2014 at 2:08 PM, Michael Haggerty [off-list ref] wrote:
On 06/17/2014 05:53 PM, Ronnie Sahlberg wrote:
quoted
Making errno from write_ref_sha1() meaningful, which should fix

* a bug in "git checkout -b" where it prints strerror(errno)
  despite errno possibly being zero or clobbered

* a bug in "git fetch"'s s_update_ref, which trusts the result of an
  errno == ENOTDIR check to detect D/F conflicts

Signed-off-by: Ronnie Sahlberg <redacted>
---
 refs.c | 29 ++++++++++++++++++++++++-----
 1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/refs.c b/refs.c
index 211429d..1f2eb24 100644
--- a/refs.c
+++ b/refs.c
@@ -1979,6 +1979,7 @@ static int remove_empty_directories(const char *file)
      result = remove_dir_recursively(&path, REMOVE_DIR_EMPTY_ONLY);
      save_errno = errno;

+     errno = save_errno;
      strbuf_release(&path);
      errno = save_errno;
This new line looks like an accident.
Yepp.  Too many rebases.

Thanks.
quoted
[...]
Michael

--
Michael Haggerty
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help