Skip to content

Commit

Permalink
Merge branch 'fix-CTest-failures'
Browse files Browse the repository at this point in the history
This topic branch fixes a couple of problems when running Git for
Windows' tests via CTest (e.g. inside Visual Studio).

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Aug 9, 2022
2 parents 79972f5 + 0070712 commit 5c263f7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion add-patch.c
Original file line number Diff line number Diff line change
Expand Up @@ -1547,7 +1547,7 @@ static int patch_update_file(struct add_p_state *s,
strbuf_remove(&s->answer, 0, 1);
strbuf_trim(&s->answer);
i = hunk_index - DISPLAY_HUNKS_LINES / 2;
if (i < file_diff->mode_change)
if (i < (int)file_diff->mode_change)
i = file_diff->mode_change;
while (s->answer.len == 0) {
i = display_hunks(s, file_diff, i);
Expand Down
5 changes: 3 additions & 2 deletions contrib/buildsystems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,8 @@ if(NOT ${CMAKE_BINARY_DIR}/CMakeCache.txt STREQUAL ${CACHE_PATH})
#misc copies
file(COPY ${CMAKE_SOURCE_DIR}/t/chainlint.sed DESTINATION ${CMAKE_BINARY_DIR}/t/)
file(COPY ${CMAKE_SOURCE_DIR}/po/is.po DESTINATION ${CMAKE_BINARY_DIR}/po/)
file(COPY ${CMAKE_SOURCE_DIR}/mergetools/tkdiff DESTINATION ${CMAKE_BINARY_DIR}/mergetools/)
file(GLOB mergetools "${CMAKE_SOURCE_DIR}/mergetools/*")
file(COPY ${mergetools} DESTINATION ${CMAKE_BINARY_DIR}/mergetools/)
file(COPY ${CMAKE_SOURCE_DIR}/contrib/completion/git-prompt.sh DESTINATION ${CMAKE_BINARY_DIR}/contrib/completion/)
file(COPY ${CMAKE_SOURCE_DIR}/contrib/completion/git-completion.bash DESTINATION ${CMAKE_BINARY_DIR}/contrib/completion/)
endif()
Expand All @@ -1123,7 +1124,7 @@ file(GLOB test_scipts "${CMAKE_SOURCE_DIR}/t/t[0-9]*.sh")
#test
foreach(tsh ${test_scipts})
add_test(NAME ${tsh}
COMMAND ${SH_EXE} ${tsh}
COMMAND ${SH_EXE} ${tsh} --no-bin-wrappers --no-chain-lint -vx
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/t)
endforeach()

Expand Down
10 changes: 8 additions & 2 deletions t/test-lib-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,10 @@ test_commit_bulk () {
# of a file in the working directory and add it to the index.

test_chmod () {
chmod "$@" &&
if test_have_prereq !MINGW
then
chmod "$@"
fi &&
git update-index --add "--chmod=$@"
}

Expand Down Expand Up @@ -548,7 +551,10 @@ write_script () {
echo "#!${2-"$SHELL_PATH"}" &&
cat
} >"$1" &&
chmod +x "$1"
if test_have_prereq !MINGW
then
chmod +x "$1"
fi
}

# Usage: test_hook [options] <hook-name> <<-\EOF
Expand Down

0 comments on commit 5c263f7

Please sign in to comment.