Merge branch 'ps/submodule-sanitize-path-upon-add' into maint
"git submodule add" failed to squash "path/to/././submodule" to "path/to/submodule". * ps/submodule-sanitize-path-upon-add: git-submodule.sh: fix '/././' path normalizationmaint
						commit
						3630be2749
					
				|  | @ -423,7 +423,7 @@ cmd_add() | ||||||
| 		sed -e ' | 		sed -e ' | ||||||
| 			s|//*|/|g | 			s|//*|/|g | ||||||
| 			s|^\(\./\)*|| | 			s|^\(\./\)*|| | ||||||
| 			s|/\./|/|g | 			s|/\(\./\)*|/|g | ||||||
| 			:start | 			:start | ||||||
| 			s|\([^/]*\)/\.\./|| | 			s|\([^/]*\)/\.\./|| | ||||||
| 			tstart | 			tstart | ||||||
|  |  | ||||||
|  | @ -171,6 +171,23 @@ test_expect_success 'submodule add with ./ in path' ' | ||||||
| 	test_cmp empty untracked | 	test_cmp empty untracked | ||||||
| ' | ' | ||||||
|  |  | ||||||
|  | test_expect_success 'submodule add with /././ in path' ' | ||||||
|  | 	echo "refs/heads/master" >expect && | ||||||
|  | 	>empty && | ||||||
|  |  | ||||||
|  | 	( | ||||||
|  | 		cd addtest && | ||||||
|  | 		git submodule add "$submodurl" dotslashdotsubmod/././frotz/./ && | ||||||
|  | 		git submodule init | ||||||
|  | 	) && | ||||||
|  |  | ||||||
|  | 	rm -f heads head untracked && | ||||||
|  | 	inspect addtest/dotslashdotsubmod/frotz ../../.. && | ||||||
|  | 	test_cmp expect heads && | ||||||
|  | 	test_cmp expect head && | ||||||
|  | 	test_cmp empty untracked | ||||||
|  | ' | ||||||
|  |  | ||||||
| test_expect_success 'submodule add with // in path' ' | test_expect_success 'submodule add with // in path' ' | ||||||
| 	echo "refs/heads/master" >expect && | 	echo "refs/heads/master" >expect && | ||||||
| 	>empty && | 	>empty && | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	 Junio C Hamano
						Junio C Hamano