Merge branch 'pt/mingw-misc-fixes'
* pt/mingw-misc-fixes: t9901: fix line-ending dependency on windows mingw: ensure sockets are initialized before calling gethostname mergetools: use the correct tool for Beyond Compare 3 on Windows t9300: do not run --cat-blob-fd related tests on MinGW git-svn: On MSYS, escape and quote SVN_SSH also if set by the user t9001: do not fail only due to CR/LF issues t1020: disable the pwd test on MinGW
This commit is contained in:
		@ -1321,6 +1321,13 @@ static void ensure_socket_initialization(void)
 | 
				
			|||||||
	initialized = 1;
 | 
						initialized = 1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#undef gethostname
 | 
				
			||||||
 | 
					int mingw_gethostname(char *name, int namelen)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    ensure_socket_initialization();
 | 
				
			||||||
 | 
					    return gethostname(name, namelen);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#undef gethostbyname
 | 
					#undef gethostbyname
 | 
				
			||||||
struct hostent *mingw_gethostbyname(const char *host)
 | 
					struct hostent *mingw_gethostbyname(const char *host)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
				
			|||||||
@ -190,6 +190,9 @@ char *mingw_getcwd(char *pointer, int len);
 | 
				
			|||||||
char *mingw_getenv(const char *name);
 | 
					char *mingw_getenv(const char *name);
 | 
				
			||||||
#define getenv mingw_getenv
 | 
					#define getenv mingw_getenv
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					int mingw_gethostname(char *host, int namelen);
 | 
				
			||||||
 | 
					#define gethostname mingw_gethostname
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct hostent *mingw_gethostbyname(const char *host);
 | 
					struct hostent *mingw_gethostbyname(const char *host);
 | 
				
			||||||
#define gethostbyname mingw_gethostbyname
 | 
					#define gethostbyname mingw_gethostbyname
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										15
									
								
								git-svn.perl
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								git-svn.perl
									
									
									
									
									
								
							@ -22,14 +22,13 @@ $Git::SVN::default_ref_id = $ENV{GIT_SVN_ID} || 'git-svn';
 | 
				
			|||||||
$Git::SVN::Ra::_log_window_size = 100;
 | 
					$Git::SVN::Ra::_log_window_size = 100;
 | 
				
			||||||
$Git::SVN::_minimize_url = 'unset';
 | 
					$Git::SVN::_minimize_url = 'unset';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if (! exists $ENV{SVN_SSH}) {
 | 
					if (! exists $ENV{SVN_SSH} && exists $ENV{GIT_SSH}) {
 | 
				
			||||||
	if (exists $ENV{GIT_SSH}) {
 | 
						$ENV{SVN_SSH} = $ENV{GIT_SSH};
 | 
				
			||||||
		$ENV{SVN_SSH} = $ENV{GIT_SSH};
 | 
					}
 | 
				
			||||||
		if ($^O eq 'msys') {
 | 
					
 | 
				
			||||||
			$ENV{SVN_SSH} =~ s/\\/\\\\/g;
 | 
					if (exists $ENV{SVN_SSH} && $^O eq 'msys') {
 | 
				
			||||||
			$ENV{SVN_SSH} =~ s/(.*)/"$1"/;
 | 
						$ENV{SVN_SSH} =~ s/\\/\\\\/g;
 | 
				
			||||||
		}
 | 
						$ENV{SVN_SSH} =~ s/(.*)/"$1"/;
 | 
				
			||||||
	}
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
$Git::SVN::Log::TZ = $ENV{TZ};
 | 
					$Git::SVN::Log::TZ = $ENV{TZ};
 | 
				
			||||||
 | 
				
			|||||||
@ -16,5 +16,10 @@ merge_cmd () {
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
translate_merge_tool_path() {
 | 
					translate_merge_tool_path() {
 | 
				
			||||||
	echo bcompare
 | 
						if type bcomp >/dev/null 2>/dev/null
 | 
				
			||||||
 | 
						then
 | 
				
			||||||
 | 
							echo bcomp
 | 
				
			||||||
 | 
						else
 | 
				
			||||||
 | 
							echo bcompare
 | 
				
			||||||
 | 
						fi
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -118,7 +118,7 @@ test_expect_success 'alias expansion' '
 | 
				
			|||||||
	)
 | 
						)
 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success '!alias expansion' '
 | 
					test_expect_success NOT_MINGW '!alias expansion' '
 | 
				
			||||||
	pwd >expect &&
 | 
						pwd >expect &&
 | 
				
			||||||
	(
 | 
						(
 | 
				
			||||||
		git config alias.test !pwd &&
 | 
							git config alias.test !pwd &&
 | 
				
			||||||
 | 
				
			|||||||
@ -23,6 +23,7 @@ test_expect_success $PREREQ \
 | 
				
			|||||||
      echo do
 | 
					      echo do
 | 
				
			||||||
      echo "  echo \"!\$a!\""
 | 
					      echo "  echo \"!\$a!\""
 | 
				
			||||||
      echo "done >commandline\$output"
 | 
					      echo "done >commandline\$output"
 | 
				
			||||||
 | 
					      test_have_prereq MINGW && echo "dos2unix commandline\$output"
 | 
				
			||||||
      echo "cat > msgtxt\$output"
 | 
					      echo "cat > msgtxt\$output"
 | 
				
			||||||
      ) >fake.sendmail &&
 | 
					      ) >fake.sendmail &&
 | 
				
			||||||
     chmod +x ./fake.sendmail &&
 | 
					     chmod +x ./fake.sendmail &&
 | 
				
			||||||
 | 
				
			|||||||
@ -2237,7 +2237,7 @@ test_expect_success 'R: cat-blob-fd must be a nonnegative integer' '
 | 
				
			|||||||
	test_must_fail git fast-import --cat-blob-fd=-1 </dev/null
 | 
						test_must_fail git fast-import --cat-blob-fd=-1 </dev/null
 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'R: print old blob' '
 | 
					test_expect_success NOT_MINGW 'R: print old blob' '
 | 
				
			||||||
	blob=$(echo "yes it can" | git hash-object -w --stdin) &&
 | 
						blob=$(echo "yes it can" | git hash-object -w --stdin) &&
 | 
				
			||||||
	cat >expect <<-EOF &&
 | 
						cat >expect <<-EOF &&
 | 
				
			||||||
	${blob} blob 11
 | 
						${blob} blob 11
 | 
				
			||||||
@ -2249,7 +2249,7 @@ test_expect_success 'R: print old blob' '
 | 
				
			|||||||
	test_cmp expect actual
 | 
						test_cmp expect actual
 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'R: in-stream cat-blob-fd not respected' '
 | 
					test_expect_success NOT_MINGW 'R: in-stream cat-blob-fd not respected' '
 | 
				
			||||||
	echo hello >greeting &&
 | 
						echo hello >greeting &&
 | 
				
			||||||
	blob=$(git hash-object -w greeting) &&
 | 
						blob=$(git hash-object -w greeting) &&
 | 
				
			||||||
	cat >expect <<-EOF &&
 | 
						cat >expect <<-EOF &&
 | 
				
			||||||
@ -2270,7 +2270,7 @@ test_expect_success 'R: in-stream cat-blob-fd not respected' '
 | 
				
			|||||||
	test_cmp expect actual.1
 | 
						test_cmp expect actual.1
 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'R: print new blob' '
 | 
					test_expect_success NOT_MINGW 'R: print new blob' '
 | 
				
			||||||
	blob=$(echo "yep yep yep" | git hash-object --stdin) &&
 | 
						blob=$(echo "yep yep yep" | git hash-object --stdin) &&
 | 
				
			||||||
	cat >expect <<-EOF &&
 | 
						cat >expect <<-EOF &&
 | 
				
			||||||
	${blob} blob 12
 | 
						${blob} blob 12
 | 
				
			||||||
@ -2288,7 +2288,7 @@ test_expect_success 'R: print new blob' '
 | 
				
			|||||||
	test_cmp expect actual
 | 
						test_cmp expect actual
 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success 'R: print new blob by sha1' '
 | 
					test_expect_success NOT_MINGW 'R: print new blob by sha1' '
 | 
				
			||||||
	blob=$(echo "a new blob named by sha1" | git hash-object --stdin) &&
 | 
						blob=$(echo "a new blob named by sha1" | git hash-object --stdin) &&
 | 
				
			||||||
	cat >expect <<-EOF &&
 | 
						cat >expect <<-EOF &&
 | 
				
			||||||
	${blob} blob 25
 | 
						${blob} blob 25
 | 
				
			||||||
 | 
				
			|||||||
@ -7,31 +7,32 @@ This test checks that git web--browse can handle various valid URLs.'
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
. ./test-lib.sh
 | 
					. ./test-lib.sh
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					test_web_browse () {
 | 
				
			||||||
 | 
						# browser=$1 url=$2
 | 
				
			||||||
 | 
						git web--browse --browser="$1" "$2" >actual &&
 | 
				
			||||||
 | 
						tr -d '\015' <actual >text &&
 | 
				
			||||||
 | 
						test_cmp expect text
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success \
 | 
					test_expect_success \
 | 
				
			||||||
	'URL with an ampersand in it' '
 | 
						'URL with an ampersand in it' '
 | 
				
			||||||
	echo http://example.com/foo\&bar >expect &&
 | 
						echo http://example.com/foo\&bar >expect &&
 | 
				
			||||||
	git config browser.custom.cmd echo &&
 | 
						git config browser.custom.cmd echo &&
 | 
				
			||||||
	git web--browse --browser=custom \
 | 
						test_web_browse custom http://example.com/foo\&bar
 | 
				
			||||||
		http://example.com/foo\&bar >actual &&
 | 
					 | 
				
			||||||
	test_cmp expect actual
 | 
					 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success \
 | 
					test_expect_success \
 | 
				
			||||||
	'URL with a semi-colon in it' '
 | 
						'URL with a semi-colon in it' '
 | 
				
			||||||
	echo http://example.com/foo\;bar >expect &&
 | 
						echo http://example.com/foo\;bar >expect &&
 | 
				
			||||||
	git config browser.custom.cmd echo &&
 | 
						git config browser.custom.cmd echo &&
 | 
				
			||||||
	git web--browse --browser=custom \
 | 
						test_web_browse custom http://example.com/foo\;bar
 | 
				
			||||||
		http://example.com/foo\;bar >actual &&
 | 
					 | 
				
			||||||
	test_cmp expect actual
 | 
					 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success \
 | 
					test_expect_success \
 | 
				
			||||||
	'URL with a hash in it' '
 | 
						'URL with a hash in it' '
 | 
				
			||||||
	echo http://example.com/foo#bar >expect &&
 | 
						echo http://example.com/foo#bar >expect &&
 | 
				
			||||||
	git config browser.custom.cmd echo &&
 | 
						git config browser.custom.cmd echo &&
 | 
				
			||||||
	git web--browse --browser=custom \
 | 
						test_web_browse custom http://example.com/foo#bar
 | 
				
			||||||
		http://example.com/foo#bar >actual &&
 | 
					 | 
				
			||||||
	test_cmp expect actual
 | 
					 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success \
 | 
					test_expect_success \
 | 
				
			||||||
@ -43,9 +44,7 @@ test_expect_success \
 | 
				
			|||||||
	EOF
 | 
						EOF
 | 
				
			||||||
	chmod +x "fake browser" &&
 | 
						chmod +x "fake browser" &&
 | 
				
			||||||
	git config browser.w3m.path "`pwd`/fake browser" &&
 | 
						git config browser.w3m.path "`pwd`/fake browser" &&
 | 
				
			||||||
	git web--browse --browser=w3m \
 | 
						test_web_browse w3m http://example.com/foo
 | 
				
			||||||
		http://example.com/foo >actual &&
 | 
					 | 
				
			||||||
	test_cmp expect actual
 | 
					 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_expect_success \
 | 
					test_expect_success \
 | 
				
			||||||
@ -58,9 +57,7 @@ test_expect_success \
 | 
				
			|||||||
			done
 | 
								done
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		f" &&
 | 
							f" &&
 | 
				
			||||||
	git web--browse --browser=custom \
 | 
						test_web_browse custom http://example.com/foo
 | 
				
			||||||
		http://example.com/foo >actual &&
 | 
					 | 
				
			||||||
	test_cmp expect actual
 | 
					 | 
				
			||||||
'
 | 
					'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_done
 | 
					test_done
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user