aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/RelNotes/2.7.0.txt3
-rwxr-xr-xGIT-VERSION-GEN2
-rw-r--r--builtin/push.c2
-rw-r--r--compat/mingw.c17
-rw-r--r--compat/mingw.h3
5 files changed, 25 insertions, 2 deletions
diff --git a/Documentation/RelNotes/2.7.0.txt b/Documentation/RelNotes/2.7.0.txt
index 215528b4b8..dbc3fea7fa 100644
--- a/Documentation/RelNotes/2.7.0.txt
+++ b/Documentation/RelNotes/2.7.0.txt
@@ -171,6 +171,9 @@ Performance, Internal Implementation, Development Support etc.
git/git (including build-status for pull requests that people
open).
+ * The write(2) emulation for Windows learned to set errno to EPIPE
+ when necessary.
+
Also contains various documentation updates and code clean-ups.
diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 4478007b01..904265b2c1 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
-DEF_VER=v2.7.0-rc1
+DEF_VER=v2.7.0-rc2
LF='
'
diff --git a/builtin/push.c b/builtin/push.c
index cc29277ea2..8963dbdf3d 100644
--- a/builtin/push.c
+++ b/builtin/push.c
@@ -547,7 +547,7 @@ int cmd_push(int argc, const char **argv, const char *prefix)
0, CAS_OPT_NAME, &cas, N_("refname>:<expect"),
N_("require old value of ref to be at this value"),
PARSE_OPT_OPTARG, parseopt_push_cas_option },
- { OPTION_CALLBACK, 0, "recurse-submodules", &recurse_submodules, N_("check|on-demand|no"),
+ { OPTION_CALLBACK, 0, "recurse-submodules", &recurse_submodules, "check|on-demand|no",
N_("control recursive pushing of submodules"),
PARSE_OPT_OPTARG, option_parse_recurse_submodules },
OPT_BOOL( 0 , "thin", &thin, N_("use thin pack")),
diff --git a/compat/mingw.c b/compat/mingw.c
index 90bdb1edde..5edea29508 100644
--- a/compat/mingw.c
+++ b/compat/mingw.c
@@ -394,6 +394,23 @@ int mingw_fflush(FILE *stream)
return ret;
}
+#undef write
+ssize_t mingw_write(int fd, const void *buf, size_t len)
+{
+ ssize_t result = write(fd, buf, len);
+
+ if (result < 0 && errno == EINVAL && buf) {
+ /* check if fd is a pipe */
+ HANDLE h = (HANDLE) _get_osfhandle(fd);
+ if (GetFileType(h) == FILE_TYPE_PIPE)
+ errno = EPIPE;
+ else
+ errno = EINVAL;
+ }
+
+ return result;
+}
+
int mingw_access(const char *filename, int mode)
{
wchar_t wfilename[MAX_PATH];
diff --git a/compat/mingw.h b/compat/mingw.h
index 738865c6c0..57ca477d1f 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -210,6 +210,9 @@ FILE *mingw_freopen (const char *filename, const char *otype, FILE *stream);
int mingw_fflush(FILE *stream);
#define fflush mingw_fflush
+ssize_t mingw_write(int fd, const void *buf, size_t len);
+#define write mingw_write
+
int mingw_access(const char *filename, int mode);
#undef access
#define access mingw_access