Revision 865406bc5426d5196935e37a3a5fde9c843c3e96 authored by Philip Oakley on 29 July 2019, 20:08:03 UTC, committed by Junio C Hamano on 29 July 2019, 21:51:42 UTC
Since 4b623d8 (MSVC: link in invalidcontinue.obj for better POSIX
compatibility, 2014-03-29), invalidcontinue.obj is linked in the MSVC
build, but it was not parsed correctly by the buildsystem. Ignore it, as
it is known to Visual Studio and will be handled elsewhere.

Also only substitute filenames ending with .o when generating the
source .c filename, otherwise we would start to expect .cbj files to
generate .obj files (which are not generated by our build)...

In the future there may be source files that produce .obj files
so keep the two issues (.obj files with & without source files)
separate.

Signed-off-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Duncan Smart <duncan.smart@gmail.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 158471d
Raw File
t5900-repo-selection.sh
#!/bin/sh

test_description='selecting remote repo in ambiguous cases'
. ./test-lib.sh

reset() {
	rm -rf foo foo.git fetch clone
}

make_tree() {
	git init "$1" &&
	(cd "$1" && test_commit "$1")
}

make_bare() {
	git init --bare "$1" &&
	(cd "$1" &&
	 tree=$(git hash-object -w -t tree /dev/null) &&
	 commit=$(echo "$1" | git commit-tree $tree) &&
	 git update-ref HEAD $commit
	)
}

get() {
	git init --bare fetch &&
	(cd fetch && git fetch "../$1") &&
	git clone "$1" clone
}

check() {
	echo "$1" >expect &&
	(cd fetch && git log -1 --format=%s FETCH_HEAD) >actual.fetch &&
	(cd clone && git log -1 --format=%s HEAD) >actual.clone &&
	test_cmp expect actual.fetch &&
	test_cmp expect actual.clone
}

test_expect_success 'find .git dir in worktree' '
	reset &&
	make_tree foo &&
	get foo &&
	check foo
'

test_expect_success 'automagically add .git suffix' '
	reset &&
	make_bare foo.git &&
	get foo &&
	check foo.git
'

test_expect_success 'automagically add .git suffix to worktree' '
	reset &&
	make_tree foo.git &&
	get foo &&
	check foo.git
'

test_expect_success 'prefer worktree foo over bare foo.git' '
	reset &&
	make_tree foo &&
	make_bare foo.git &&
	get foo &&
	check foo
'

test_expect_success 'prefer bare foo over bare foo.git' '
	reset &&
	make_bare foo &&
	make_bare foo.git &&
	get foo &&
	check foo
'

test_expect_success 'disambiguate with full foo.git' '
	reset &&
	make_bare foo &&
	make_bare foo.git &&
	get foo.git &&
	check foo.git
'

test_expect_success 'we are not fooled by non-git foo directory' '
	reset &&
	make_bare foo.git &&
	mkdir foo &&
	get foo &&
	check foo.git
'

test_expect_success 'prefer inner .git over outer bare' '
	reset &&
	make_tree foo &&
	make_bare foo.git &&
	mv foo/.git foo.git &&
	get foo.git &&
	check foo
'

test_done
back to top