Compare commits
22 Commits
v2.42.0-rc
...
v2.42.0-rc
Author | SHA1 | Date | |
---|---|---|---|
f1ed9d7dc0 | |||
f9fe84b5a2 | |||
8e12aaa7ce | |||
cecd6a5ffc | |||
32f4fa8d3b | |||
fc6bba66bc | |||
fc71d024ad | |||
6df312ad31 | |||
aea6c0531c | |||
f12cb5052d | |||
e5cb1e3f09 | |||
231e86c10c | |||
0050f8e401 | |||
4b8a2717bb | |||
b3dcd24b8a | |||
72695d8214 | |||
3284b93862 | |||
cb888bb699 | |||
c016726c2d | |||
dfd46bae92 | |||
12009a182b | |||
ff29a61cbb |
@ -277,6 +277,17 @@ Fixes since v2.41
|
|||||||
corrected.
|
corrected.
|
||||||
(merge 6ce7afe163 pw/rebase-skip-commit-message-fix later to maint).
|
(merge 6ce7afe163 pw/rebase-skip-commit-message-fix later to maint).
|
||||||
|
|
||||||
|
* Adjust to newer Term::ReadLine to prevent it from breaking
|
||||||
|
the interactive prompt code in send-email.
|
||||||
|
(merge c016726c2d jk/send-email-with-new-readline later to maint).
|
||||||
|
|
||||||
|
* Windows updates.
|
||||||
|
(merge 0050f8e401 ds/maintenance-on-windows-fix later to maint).
|
||||||
|
|
||||||
|
* Correct use of lstat() that assumed a failing call would not
|
||||||
|
clobber the statbuf.
|
||||||
|
(merge 72695d8214 st/mv-lstat-fix later to maint).
|
||||||
|
|
||||||
* Other code cleanup, docfix, build fix, etc.
|
* Other code cleanup, docfix, build fix, etc.
|
||||||
(merge 51f9d2e563 sa/doc-ls-remote later to maint).
|
(merge 51f9d2e563 sa/doc-ls-remote later to maint).
|
||||||
(merge c6d26a9dda jk/format-patch-message-id-unleak later to maint).
|
(merge c6d26a9dda jk/format-patch-message-id-unleak later to maint).
|
||||||
@ -314,3 +325,5 @@ Fixes since v2.41
|
|||||||
(merge d089a06421 rs/bundle-parseopt-cleanup later to maint).
|
(merge d089a06421 rs/bundle-parseopt-cleanup later to maint).
|
||||||
(merge 823839bda1 ew/sha256-gcrypt-leak-fixes later to maint).
|
(merge 823839bda1 ew/sha256-gcrypt-leak-fixes later to maint).
|
||||||
(merge a5c01603b3 bc/ignore-clangd-cache later to maint).
|
(merge a5c01603b3 bc/ignore-clangd-cache later to maint).
|
||||||
|
(merge 12009a182b js/allow-t4000-to-be-indented-with-spaces later to maint).
|
||||||
|
(merge b3dcd24b8a jc/send-email-pre-process-fix later to maint).
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
GVF=GIT-VERSION-FILE
|
GVF=GIT-VERSION-FILE
|
||||||
DEF_VER=v2.42.0-rc1
|
DEF_VER=v2.42.0-rc2
|
||||||
|
|
||||||
LF='
|
LF='
|
||||||
'
|
'
|
||||||
|
9
Makefile
9
Makefile
@ -2779,6 +2779,13 @@ compat/nedmalloc/nedmalloc.sp compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
|
|||||||
compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null
|
compat/nedmalloc/nedmalloc.sp: SP_EXTRA_FLAGS += -Wno-non-pointer-null
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
headless-git.o: compat/win32/headless.c GIT-CFLAGS
|
||||||
|
$(QUIET_CC)$(CC) $(ALL_CFLAGS) $(COMPAT_CFLAGS) \
|
||||||
|
-fno-stack-protector -o $@ -c -Wall -Wwrite-strings $<
|
||||||
|
|
||||||
|
headless-git$X: headless-git.o git.res GIT-LDFLAGS
|
||||||
|
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) $(ALL_LDFLAGS) -mwindows -o $@ $< git.res
|
||||||
|
|
||||||
git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
|
git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
|
||||||
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
|
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
|
||||||
|
|
||||||
@ -3658,6 +3665,7 @@ clean: profile-clean coverage-clean cocciclean
|
|||||||
$(RM) po/git.pot po/git-core.pot
|
$(RM) po/git.pot po/git-core.pot
|
||||||
$(RM) git.res
|
$(RM) git.res
|
||||||
$(RM) $(OBJECTS)
|
$(RM) $(OBJECTS)
|
||||||
|
$(RM) headless-git.o
|
||||||
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)
|
$(RM) $(LIB_FILE) $(XDIFF_LIB) $(REFTABLE_LIB) $(REFTABLE_TEST_LIB)
|
||||||
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)
|
$(RM) $(ALL_PROGRAMS) $(SCRIPT_LIB) $(BUILT_INS) $(OTHER_PROGRAMS)
|
||||||
$(RM) $(TEST_PROGRAMS)
|
$(RM) $(TEST_PROGRAMS)
|
||||||
@ -3686,6 +3694,7 @@ endif
|
|||||||
$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
|
$(RM) GIT-SCRIPT-DEFINES GIT-PERL-DEFINES GIT-PERL-HEADER GIT-PYTHON-VARS
|
||||||
ifdef MSVC
|
ifdef MSVC
|
||||||
$(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS))
|
$(RM) $(patsubst %.o,%.o.pdb,$(OBJECTS))
|
||||||
|
$(RM) headless-git.o.pdb
|
||||||
$(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS))
|
$(RM) $(patsubst %.exe,%.pdb,$(OTHER_PROGRAMS))
|
||||||
$(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS))
|
$(RM) $(patsubst %.exe,%.iobj,$(OTHER_PROGRAMS))
|
||||||
$(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS))
|
$(RM) $(patsubst %.exe,%.ipdb,$(OTHER_PROGRAMS))
|
||||||
|
5
advice.c
5
advice.c
@ -191,9 +191,10 @@ int error_resolve_conflict(const char *me)
|
|||||||
error(_("Pulling is not possible because you have unmerged files."));
|
error(_("Pulling is not possible because you have unmerged files."));
|
||||||
else if (!strcmp(me, "revert"))
|
else if (!strcmp(me, "revert"))
|
||||||
error(_("Reverting is not possible because you have unmerged files."));
|
error(_("Reverting is not possible because you have unmerged files."));
|
||||||
|
else if (!strcmp(me, "rebase"))
|
||||||
|
error(_("Rebasing is not possible because you have unmerged files."));
|
||||||
else
|
else
|
||||||
error(_("It is not possible to %s because you have unmerged files."),
|
BUG("Unhandled conflict reason '%s'", me);
|
||||||
me);
|
|
||||||
|
|
||||||
if (advice_enabled(ADVICE_RESOLVE_CONFLICT))
|
if (advice_enabled(ADVICE_RESOLVE_CONFLICT))
|
||||||
/*
|
/*
|
||||||
|
@ -2068,7 +2068,7 @@ static int schtasks_schedule_task(const char *exec_path, enum schedule_priority
|
|||||||
"</Settings>\n"
|
"</Settings>\n"
|
||||||
"<Actions Context=\"Author\">\n"
|
"<Actions Context=\"Author\">\n"
|
||||||
"<Exec>\n"
|
"<Exec>\n"
|
||||||
"<Command>\"%s\\git.exe\"</Command>\n"
|
"<Command>\"%s\\headless-git.exe\"</Command>\n"
|
||||||
"<Arguments>--exec-path=\"%s\" for-each-repo --config=maintenance.repo maintenance run --schedule=%s</Arguments>\n"
|
"<Arguments>--exec-path=\"%s\" for-each-repo --config=maintenance.repo maintenance run --schedule=%s</Arguments>\n"
|
||||||
"</Exec>\n"
|
"</Exec>\n"
|
||||||
"</Actions>\n"
|
"</Actions>\n"
|
||||||
|
@ -184,7 +184,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
|
|||||||
int src_dir_nr = 0, src_dir_alloc = 0;
|
int src_dir_nr = 0, src_dir_alloc = 0;
|
||||||
struct strbuf a_src_dir = STRBUF_INIT;
|
struct strbuf a_src_dir = STRBUF_INIT;
|
||||||
enum update_mode *modes, dst_mode = 0;
|
enum update_mode *modes, dst_mode = 0;
|
||||||
struct stat st;
|
struct stat st, dest_st;
|
||||||
struct string_list src_for_dst = STRING_LIST_INIT_NODUP;
|
struct string_list src_for_dst = STRING_LIST_INIT_NODUP;
|
||||||
struct lock_file lock_file = LOCK_INIT;
|
struct lock_file lock_file = LOCK_INIT;
|
||||||
struct cache_entry *ce;
|
struct cache_entry *ce;
|
||||||
@ -304,7 +304,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
|
|||||||
goto act_on_entry;
|
goto act_on_entry;
|
||||||
}
|
}
|
||||||
if (S_ISDIR(st.st_mode)
|
if (S_ISDIR(st.st_mode)
|
||||||
&& lstat(dst, &st) == 0) {
|
&& lstat(dst, &dest_st) == 0) {
|
||||||
bad = _("cannot move directory over file");
|
bad = _("cannot move directory over file");
|
||||||
goto act_on_entry;
|
goto act_on_entry;
|
||||||
}
|
}
|
||||||
|
@ -492,15 +492,13 @@ static struct packed_git *get_preferred_pack(struct pack_geometry *geometry)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void clear_pack_geometry(struct pack_geometry *geometry)
|
static void free_pack_geometry(struct pack_geometry *geometry)
|
||||||
{
|
{
|
||||||
if (!geometry)
|
if (!geometry)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
free(geometry->pack);
|
free(geometry->pack);
|
||||||
geometry->pack_nr = 0;
|
free(geometry);
|
||||||
geometry->pack_alloc = 0;
|
|
||||||
geometry->split = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
struct midx_snapshot_ref_data {
|
struct midx_snapshot_ref_data {
|
||||||
@ -1228,7 +1226,7 @@ cleanup:
|
|||||||
string_list_clear(&names, 1);
|
string_list_clear(&names, 1);
|
||||||
string_list_clear(&existing_nonkept_packs, 0);
|
string_list_clear(&existing_nonkept_packs, 0);
|
||||||
string_list_clear(&existing_kept_packs, 0);
|
string_list_clear(&existing_kept_packs, 0);
|
||||||
clear_pack_geometry(geometry);
|
free_pack_geometry(geometry);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
115
compat/win32/headless.c
Normal file
115
compat/win32/headless.c
Normal file
@ -0,0 +1,115 @@
|
|||||||
|
/*
|
||||||
|
* headless Git - run Git without opening a console window on Windows
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define STRICT
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
#define UNICODE
|
||||||
|
#define _UNICODE
|
||||||
|
#include <windows.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <wchar.h>
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If `dir` contains the path to a Git exec directory, extend `PATH` to
|
||||||
|
* include the corresponding `bin/` directory (which is where all those
|
||||||
|
* `.dll` files needed by `git.exe` are, on Windows).
|
||||||
|
*/
|
||||||
|
static int extend_path(wchar_t *dir, size_t dir_len)
|
||||||
|
{
|
||||||
|
const wchar_t *suffix = L"\\libexec\\git-core";
|
||||||
|
size_t suffix_len = wcslen(suffix);
|
||||||
|
wchar_t *env;
|
||||||
|
DWORD len;
|
||||||
|
|
||||||
|
if (dir_len < suffix_len)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
dir_len -= suffix_len;
|
||||||
|
if (memcmp(dir + dir_len, suffix, suffix_len * sizeof(wchar_t)))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
len = GetEnvironmentVariableW(L"PATH", NULL, 0);
|
||||||
|
if (!len)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
env = _alloca((dir_len + 5 + len) * sizeof(wchar_t));
|
||||||
|
wcsncpy(env, dir, dir_len);
|
||||||
|
wcscpy(env + dir_len, L"\\bin;");
|
||||||
|
if (!GetEnvironmentVariableW(L"PATH", env + dir_len + 5, len))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
SetEnvironmentVariableW(L"PATH", env);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int WINAPI wWinMain(_In_ HINSTANCE instance,
|
||||||
|
_In_opt_ HINSTANCE previous_instance,
|
||||||
|
_In_ LPWSTR command_line, _In_ int show)
|
||||||
|
{
|
||||||
|
wchar_t git_command_line[32768];
|
||||||
|
size_t size = sizeof(git_command_line) / sizeof(wchar_t);
|
||||||
|
const wchar_t *needs_quotes = L"";
|
||||||
|
int slash = 0, i;
|
||||||
|
|
||||||
|
STARTUPINFO startup_info = {
|
||||||
|
.cb = sizeof(STARTUPINFO),
|
||||||
|
.dwFlags = STARTF_USESHOWWINDOW,
|
||||||
|
.wShowWindow = SW_HIDE,
|
||||||
|
};
|
||||||
|
PROCESS_INFORMATION process_info = { 0 };
|
||||||
|
DWORD creation_flags = CREATE_UNICODE_ENVIRONMENT |
|
||||||
|
CREATE_NEW_CONSOLE | CREATE_NO_WINDOW;
|
||||||
|
DWORD exit_code;
|
||||||
|
|
||||||
|
/* First, determine the full path of argv[0] */
|
||||||
|
for (i = 0; _wpgmptr[i]; i++)
|
||||||
|
if (_wpgmptr[i] == L' ')
|
||||||
|
needs_quotes = L"\"";
|
||||||
|
else if (_wpgmptr[i] == L'\\')
|
||||||
|
slash = i;
|
||||||
|
|
||||||
|
if (slash >= size - 11)
|
||||||
|
return 127; /* Too long path */
|
||||||
|
|
||||||
|
/* If it is in Git's exec path, add the bin/ directory to the PATH */
|
||||||
|
extend_path(_wpgmptr, slash);
|
||||||
|
|
||||||
|
/* Then, add the full path of `git.exe` as argv[0] */
|
||||||
|
i = swprintf_s(git_command_line, size, L"%ls%.*ls\\git.exe%ls",
|
||||||
|
needs_quotes, slash, _wpgmptr, needs_quotes);
|
||||||
|
if (i < 0)
|
||||||
|
return 127; /* Too long path */
|
||||||
|
|
||||||
|
if (*command_line) {
|
||||||
|
/* Now, append the command-line arguments */
|
||||||
|
i = swprintf_s(git_command_line + i, size - i,
|
||||||
|
L" %ls", command_line);
|
||||||
|
if (i < 0)
|
||||||
|
return 127;
|
||||||
|
}
|
||||||
|
|
||||||
|
startup_info.hStdInput = GetStdHandle(STD_INPUT_HANDLE);
|
||||||
|
startup_info.hStdOutput = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
|
startup_info.hStdError = GetStdHandle(STD_ERROR_HANDLE);
|
||||||
|
|
||||||
|
if (!CreateProcess(NULL, /* infer argv[0] from the command line */
|
||||||
|
git_command_line, /* modified command line */
|
||||||
|
NULL, /* inherit process handles? */
|
||||||
|
NULL, /* inherit thread handles? */
|
||||||
|
FALSE, /* handles inheritable? */
|
||||||
|
creation_flags,
|
||||||
|
NULL, /* use this process' environment */
|
||||||
|
NULL, /* use this process' working directory */
|
||||||
|
&startup_info, &process_info))
|
||||||
|
return 129; /* could not start */
|
||||||
|
WaitForSingleObject(process_info.hProcess, INFINITE);
|
||||||
|
if (!GetExitCodeProcess(process_info.hProcess, &exit_code))
|
||||||
|
exit_code = 130; /* Could not determine exit code? */
|
||||||
|
|
||||||
|
CloseHandle(process_info.hProcess);
|
||||||
|
CloseHandle(process_info.hThread);
|
||||||
|
|
||||||
|
return (int)exit_code;
|
||||||
|
}
|
@ -526,6 +526,8 @@ else
|
|||||||
endif
|
endif
|
||||||
X = .exe
|
X = .exe
|
||||||
|
|
||||||
|
EXTRA_PROGRAMS += headless-git$X
|
||||||
|
|
||||||
compat/msvc.o: compat/msvc.c compat/mingw.c GIT-CFLAGS
|
compat/msvc.o: compat/msvc.c compat/mingw.c GIT-CFLAGS
|
||||||
endif
|
endif
|
||||||
ifeq ($(uname_S),Interix)
|
ifeq ($(uname_S),Interix)
|
||||||
@ -705,6 +707,7 @@ ifeq ($(uname_S),MINGW)
|
|||||||
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
|
COMPAT_CFLAGS += -D__USE_MINGW_ANSI_STDIO=0 -DDETECT_MSYS_TTY \
|
||||||
-fstack-protector-strong
|
-fstack-protector-strong
|
||||||
EXTLIBS += -lntdll
|
EXTLIBS += -lntdll
|
||||||
|
EXTRA_PROGRAMS += headless-git$X
|
||||||
INSTALL = /bin/install
|
INSTALL = /bin/install
|
||||||
INTERNAL_QSORT = YesPlease
|
INTERNAL_QSORT = YesPlease
|
||||||
HAVE_LIBCHARSET_H = YesPlease
|
HAVE_LIBCHARSET_H = YesPlease
|
||||||
|
@ -738,6 +738,15 @@ if(WIN32)
|
|||||||
else()
|
else()
|
||||||
message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}")
|
message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
add_executable(headless-git ${CMAKE_SOURCE_DIR}/compat/win32/headless.c)
|
||||||
|
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID STREQUAL "Clang")
|
||||||
|
target_link_options(headless-git PUBLIC -municode -Wl,-subsystem,windows)
|
||||||
|
elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC")
|
||||||
|
target_link_options(headless-git PUBLIC /NOLOGO /ENTRY:wWinMainCRTStartup /SUBSYSTEM:WINDOWS)
|
||||||
|
else()
|
||||||
|
message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}")
|
||||||
|
endif()
|
||||||
elseif(UNIX)
|
elseif(UNIX)
|
||||||
target_link_libraries(common-main pthread rt)
|
target_link_libraries(common-main pthread rt)
|
||||||
endif()
|
endif()
|
||||||
|
@ -76,7 +76,7 @@ sub createProject {
|
|||||||
|
|
||||||
my $libs_release = "\n ";
|
my $libs_release = "\n ";
|
||||||
my $libs_debug = "\n ";
|
my $libs_debug = "\n ";
|
||||||
if (!$static_library) {
|
if (!$static_library && $name ne 'headless-git') {
|
||||||
$libs_release = join(";", sort(grep /^(?!libgit\.lib|xdiff\/lib\.lib|vcs-svn\/lib\.lib|reftable\/libreftable\.lib)/, @{$$build_structure{"$prefix${name}_LIBS"}}));
|
$libs_release = join(";", sort(grep /^(?!libgit\.lib|xdiff\/lib\.lib|vcs-svn\/lib\.lib|reftable\/libreftable\.lib)/, @{$$build_structure{"$prefix${name}_LIBS"}}));
|
||||||
$libs_debug = $libs_release;
|
$libs_debug = $libs_release;
|
||||||
$libs_debug =~ s/zlib\.lib/zlibd\.lib/g;
|
$libs_debug =~ s/zlib\.lib/zlibd\.lib/g;
|
||||||
@ -230,7 +230,7 @@ EOM
|
|||||||
print F << "EOM";
|
print F << "EOM";
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
EOM
|
EOM
|
||||||
if (!$static_library || $target =~ 'vcs-svn' || $target =~ 'xdiff') {
|
if ((!$static_library || $target =~ 'vcs-svn' || $target =~ 'xdiff') && !($name =~ /headless-git/)) {
|
||||||
my $uuid_libgit = $$build_structure{"LIBS_libgit_GUID"};
|
my $uuid_libgit = $$build_structure{"LIBS_libgit_GUID"};
|
||||||
my $uuid_libreftable = $$build_structure{"LIBS_reftable/libreftable_GUID"};
|
my $uuid_libreftable = $$build_structure{"LIBS_reftable/libreftable_GUID"};
|
||||||
my $uuid_xdiff_lib = $$build_structure{"LIBS_xdiff/lib_GUID"};
|
my $uuid_xdiff_lib = $$build_structure{"LIBS_xdiff/lib_GUID"};
|
||||||
|
@ -371,6 +371,7 @@ sub handleLinkLine
|
|||||||
# exit(1);
|
# exit(1);
|
||||||
foreach (@objfiles) {
|
foreach (@objfiles) {
|
||||||
my $sourcefile = $_;
|
my $sourcefile = $_;
|
||||||
|
$sourcefile =~ s/^headless-git\.o$/compat\/win32\/headless.c/;
|
||||||
$sourcefile =~ s/\.o$/.c/;
|
$sourcefile =~ s/\.o$/.c/;
|
||||||
push(@sources, $sourcefile);
|
push(@sources, $sourcefile);
|
||||||
push(@cflags, @{$compile_options{"${sourcefile}_CFLAGS"}});
|
push(@cflags, @{$compile_options{"${sourcefile}_CFLAGS"}});
|
||||||
|
@ -26,18 +26,6 @@ use Git::I18N;
|
|||||||
|
|
||||||
Getopt::Long::Configure qw/ pass_through /;
|
Getopt::Long::Configure qw/ pass_through /;
|
||||||
|
|
||||||
package FakeTerm;
|
|
||||||
sub new {
|
|
||||||
my ($class, $reason) = @_;
|
|
||||||
return bless \$reason, shift;
|
|
||||||
}
|
|
||||||
sub readline {
|
|
||||||
my $self = shift;
|
|
||||||
die "Cannot use readline on FakeTerm: $$self";
|
|
||||||
}
|
|
||||||
package main;
|
|
||||||
|
|
||||||
|
|
||||||
sub usage {
|
sub usage {
|
||||||
print <<EOT;
|
print <<EOT;
|
||||||
git send-email' [<options>] <file|directory>
|
git send-email' [<options>] <file|directory>
|
||||||
@ -971,18 +959,20 @@ EOT3
|
|||||||
do_edit(@files);
|
do_edit(@files);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
# Only instantiate one $term per program run, since some
|
||||||
|
# Term::ReadLine providers refuse to create a second instance.
|
||||||
|
my $term;
|
||||||
sub term {
|
sub term {
|
||||||
my $term = eval {
|
|
||||||
require Term::ReadLine;
|
require Term::ReadLine;
|
||||||
$ENV{"GIT_SEND_EMAIL_NOTTY"}
|
if (!defined $term) {
|
||||||
|
$term = $ENV{"GIT_SEND_EMAIL_NOTTY"}
|
||||||
? Term::ReadLine->new('git-send-email', \*STDIN, \*STDOUT)
|
? Term::ReadLine->new('git-send-email', \*STDIN, \*STDOUT)
|
||||||
: Term::ReadLine->new('git-send-email');
|
: Term::ReadLine->new('git-send-email');
|
||||||
};
|
|
||||||
if ($@) {
|
|
||||||
$term = FakeTerm->new("$@: going non-interactive");
|
|
||||||
}
|
}
|
||||||
return $term;
|
return $term;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sub ask {
|
sub ask {
|
||||||
my ($prompt, %arg) = @_;
|
my ($prompt, %arg) = @_;
|
||||||
|
@ -480,6 +480,9 @@ static void parse_options_check(const struct option *opts)
|
|||||||
opts->long_name))
|
opts->long_name))
|
||||||
optbug(opts, "uses feature "
|
optbug(opts, "uses feature "
|
||||||
"not supported for dashless options");
|
"not supported for dashless options");
|
||||||
|
if (opts->type == OPTION_SET_INT && !opts->defval &&
|
||||||
|
opts->long_name && !(opts->flags & PARSE_OPT_NONEG))
|
||||||
|
optbug(opts, "OPTION_SET_INT 0 should not be negatable");
|
||||||
switch (opts->type) {
|
switch (opts->type) {
|
||||||
case OPTION_COUNTUP:
|
case OPTION_COUNTUP:
|
||||||
case OPTION_BIT:
|
case OPTION_BIT:
|
||||||
|
1
t/.gitattributes
vendored
1
t/.gitattributes
vendored
@ -22,3 +22,4 @@ t[0-9][0-9][0-9][0-9]/* -whitespace
|
|||||||
/t7500/* eol=lf
|
/t7500/* eol=lf
|
||||||
/t8005/*.txt eol=lf
|
/t8005/*.txt eol=lf
|
||||||
/t9*/*.dump eol=lf
|
/t9*/*.dump eol=lf
|
||||||
|
/t0040*.sh whitespace=-indent-with-non-tab
|
||||||
|
@ -232,10 +232,6 @@ test_expect_success 'diff --no-index refuses to diff stdin and a directory' '
|
|||||||
test_expect_success PIPE 'diff --no-index refuses to diff a named pipe and a directory' '
|
test_expect_success PIPE 'diff --no-index refuses to diff a named pipe and a directory' '
|
||||||
test_when_finished "rm -f pipe" &&
|
test_when_finished "rm -f pipe" &&
|
||||||
mkfifo pipe &&
|
mkfifo pipe &&
|
||||||
{
|
|
||||||
(>pipe) &
|
|
||||||
} &&
|
|
||||||
test_when_finished "kill $!" &&
|
|
||||||
test_must_fail git diff --no-index -- pipe a 2>err &&
|
test_must_fail git diff --no-index -- pipe a 2>err &&
|
||||||
grep "fatal: cannot compare a named pipe to a directory" err
|
grep "fatal: cannot compare a named pipe to a directory" err
|
||||||
'
|
'
|
||||||
@ -248,11 +244,11 @@ test_expect_success PIPE,SYMLINKS 'diff --no-index reads from pipes' '
|
|||||||
{
|
{
|
||||||
(test_write_lines a b c >old) &
|
(test_write_lines a b c >old) &
|
||||||
} &&
|
} &&
|
||||||
test_when_finished "! kill $!" &&
|
test_when_finished "kill $! || :" &&
|
||||||
{
|
{
|
||||||
(test_write_lines a x c >new) &
|
(test_write_lines a x c >new) &
|
||||||
} &&
|
} &&
|
||||||
test_when_finished "! kill $!" &&
|
test_when_finished "kill $! || :" &&
|
||||||
|
|
||||||
cat >expect <<-EOF &&
|
cat >expect <<-EOF &&
|
||||||
diff --git a/old b/new-link
|
diff --git a/old b/new-link
|
||||||
|
@ -174,6 +174,13 @@ test_expect_success 'do not move directory over existing directory' '
|
|||||||
test_must_fail git mv path2 path0
|
test_must_fail git mv path2 path0
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'rename directory to non-existing directory' '
|
||||||
|
mkdir dir-a &&
|
||||||
|
>dir-a/f &&
|
||||||
|
git add dir-a &&
|
||||||
|
git mv dir-a non-existing-dir
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success 'move into "."' '
|
test_expect_success 'move into "."' '
|
||||||
git mv path1/path2/ .
|
git mv path1/path2/ .
|
||||||
'
|
'
|
||||||
|
@ -337,13 +337,14 @@ test_expect_success $PREREQ 'Show all headers' '
|
|||||||
test_expect_success $PREREQ 'Prompting works' '
|
test_expect_success $PREREQ 'Prompting works' '
|
||||||
clean_fake_sendmail &&
|
clean_fake_sendmail &&
|
||||||
(echo "to@example.com" &&
|
(echo "to@example.com" &&
|
||||||
echo ""
|
echo "my-message-id@example.com"
|
||||||
) | GIT_SEND_EMAIL_NOTTY=1 git send-email \
|
) | GIT_SEND_EMAIL_NOTTY=1 git send-email \
|
||||||
--smtp-server="$(pwd)/fake.sendmail" \
|
--smtp-server="$(pwd)/fake.sendmail" \
|
||||||
$patches \
|
$patches \
|
||||||
2>errors &&
|
2>errors &&
|
||||||
grep "^From: A U Thor <author@example.com>\$" msgtxt1 &&
|
grep "^From: A U Thor <author@example.com>\$" msgtxt1 &&
|
||||||
grep "^To: to@example.com\$" msgtxt1
|
grep "^To: to@example.com\$" msgtxt1 &&
|
||||||
|
grep "^In-Reply-To: <my-message-id@example.com>" msgtxt1
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success $PREREQ,AUTOIDENT 'implicit ident is allowed' '
|
test_expect_success $PREREQ,AUTOIDENT 'implicit ident is allowed' '
|
||||||
@ -659,7 +660,6 @@ test_expect_success $PREREQ 'clear message-id before parsing a new message' '
|
|||||||
clean_fake_sendmail &&
|
clean_fake_sendmail &&
|
||||||
echo true | write_script my-hooks/sendemail-validate &&
|
echo true | write_script my-hooks/sendemail-validate &&
|
||||||
test_config core.hooksPath my-hooks &&
|
test_config core.hooksPath my-hooks &&
|
||||||
GIT_SEND_EMAIL_NOTTY=1 \
|
|
||||||
git send-email --validate --to=recipient@example.com \
|
git send-email --validate --to=recipient@example.com \
|
||||||
--smtp-server="$(pwd)/fake.sendmail" \
|
--smtp-server="$(pwd)/fake.sendmail" \
|
||||||
$patches $threaded_patches &&
|
$patches $threaded_patches &&
|
||||||
|
Reference in New Issue
Block a user