diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-08-25 13:55:07 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-08-25 13:55:07 -0700 |
commit | 3dc01702dfbdbfc7116a21c4a5b32f088029bacf (patch) | |
tree | 1632731cd6f30e9a86dda0de15253f399d3e0f11 /t | |
parent | Merge branch 'dg/document-git-c-in-git-config-doc' (diff) | |
parent | mingw: ensure temporary file handles are not inherited by child processes (diff) | |
download | tgif-3dc01702dfbdbfc7116a21c4a5b32f088029bacf.tar.xz |
Merge branch 'bw/mingw-avoid-inheriting-fd-to-lockfile'
The tempfile (hence its user lockfile) API lets the caller to open
a file descriptor to a temporary file, write into it and then
finalize it by first closing the filehandle and then either
removing or renaming the temporary file. When the process spawns a
subprocess after obtaining the file descriptor, and if the
subprocess has not exited when the attempt to remove or rename is
made, the last step fails on Windows, because the subprocess has
the file descriptor still open. Open tempfile with O_CLOEXEC flag
to avoid this (on Windows, this is mapped to O_NOINHERIT).
* bw/mingw-avoid-inheriting-fd-to-lockfile:
mingw: ensure temporary file handles are not inherited by child processes
t6026-merge-attr: child processes must not inherit index.lock handles
Diffstat (limited to 't')
-rwxr-xr-x | t/t6026-merge-attr.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t6026-merge-attr.sh b/t/t6026-merge-attr.sh index ef0cbceafe..dd8f88d187 100755 --- a/t/t6026-merge-attr.sh +++ b/t/t6026-merge-attr.sh @@ -181,4 +181,17 @@ test_expect_success 'up-to-date merge without common ancestor' ' ) ' +test_expect_success 'custom merge does not lock index' ' + git reset --hard anchor && + write_script sleep-one-second.sh <<-\EOF && + sleep 1 & + EOF + + test_write_lines >.gitattributes \ + "* merge=ours" "text merge=sleep-one-second" && + test_config merge.ours.driver true && + test_config merge.sleep-one-second.driver ./sleep-one-second.sh && + git merge master +' + test_done |