git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
blob b3c9425d5565c5c2c67b7e98c6d70ff67595ae78 1511 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
 
#!/bin/sh
#
# Copyright (c) 2009 Ben Jackson
#

test_description='git svn reset'
. ./lib-git-svn.sh

test_expect_success 'setup test repository' '
	svn_cmd co "$svnrepo" s &&
	(
		cd s &&
		mkdir vis &&
		echo always visible > vis/vis.txt &&
		svn_cmd add vis &&
		svn_cmd commit -m "create visible files" &&
		mkdir hid &&
		echo initially hidden > hid/hid.txt &&
		svn_cmd add hid &&
		svn_cmd commit -m "create initially hidden files" &&
		svn_cmd up &&
		echo mod >> vis/vis.txt &&
		svn_cmd commit -m "modify vis" &&
		svn_cmd up
	)
'

test_expect_success 'clone SVN repository with hidden directory' '
	git svn init "$svnrepo" g &&
	( cd g && git svn fetch --ignore-paths="^hid" )
'

test_expect_success 'modify hidden file in SVN repo' '
	( cd s &&
	  echo mod hidden >> hid/hid.txt &&
	  svn_cmd commit -m "modify hid" &&
	  svn_cmd up
	)
'

test_expect_success 'fetch fails on modified hidden file' '
	( cd g &&
	  git svn find-rev refs/remotes/git-svn > ../expect &&
	  test_must_fail git svn fetch 2> ../errors &&
	  git svn find-rev refs/remotes/git-svn > ../expect2 ) &&
	grep -F "not found in commit" errors &&
	test_cmp expect expect2
'

test_expect_success 'reset unwinds back to r1' '
	( cd g &&
	  git svn reset -r1 &&
	  git svn find-rev refs/remotes/git-svn > ../expect2 ) &&
	echo 1 >expect &&
	test_cmp expect expect2
'

test_expect_success 'refetch succeeds not ignoring any files' '
	( cd g &&
	  git svn fetch &&
	  git svn rebase &&
	  grep -F "mod hidden" hid/hid.txt
	)
'

test_done

debug log:

solving b3c9425d55 ...
found b3c9425d55 in https://public-inbox.org/git/213412d2f747de7e3b3504630cb6fcc1b96c46c7.1663688697.git.congdanhqx@gmail.com/ ||
	https://public-inbox.org/git/20211112225334.1862016-1-ville.skytta@iki.fi/
found e855904629 in https://80x24.org/mirrors/git.git
preparing index
index prepared:
100755 e8559046296ce5570ec46b2b3a9280f0a493bbc4	t/t9140-git-svn-reset.sh

applying [1/1] https://public-inbox.org/git/213412d2f747de7e3b3504630cb6fcc1b96c46c7.1663688697.git.congdanhqx@gmail.com/
diff --git a/t/t9140-git-svn-reset.sh b/t/t9140-git-svn-reset.sh
index e855904629..b3c9425d55 100755

Checking patch t/t9140-git-svn-reset.sh...
Applied patch t/t9140-git-svn-reset.sh cleanly.

skipping https://public-inbox.org/git/20211112225334.1862016-1-ville.skytta@iki.fi/ for b3c9425d55
index at:
100755 b3c9425d5565c5c2c67b7e98c6d70ff67595ae78	t/t9140-git-svn-reset.sh

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).