diff tests/test-convert-git.t @ 25698:307370c2dda2

convert: handle .gitmodules with non-tab whitespaces The old implementation assumed .gitmodules file lines always began with tabs. It can be any whitespace, so lets trim the lines appropriately.
author Durham Goode <durham@fb.com>
date Mon, 29 Jun 2015 17:19:18 -0700
parents 603a8d09e12d
children 5c97a4ecbdd4
line wrap: on
line diff
--- a/tests/test-convert-git.t	Mon Jun 29 13:39:05 2015 -0700
+++ b/tests/test-convert-git.t	Mon Jun 29 17:19:18 2015 -0700
@@ -457,6 +457,31 @@
   $ git init-db >/dev/null 2>/dev/null
   $ git submodule add ${BASE} >/dev/null 2>/dev/null
   $ commit -a -m 'addsubmodule' >/dev/null 2>/dev/null
+
+test non-tab whitespace .gitmodules
+
+  $ cat >> .gitmodules <<EOF
+  > [submodule "git-repo5"]
+  >   path = git-repo5
+  >   url = $TESTTMP/git-repo5
+  > EOF
+  $ git commit -a -m "weird white space submodule"
+  [master *] weird white space submodule (glob)
+   Author: nottest <test@example.org>
+   1 file changed, 3 insertions(+)
+  $ cd ..
+  $ hg convert git-repo6 hg-repo6
+  initializing destination hg-repo6 repository
+  scanning source...
+  sorting...
+  converting...
+  1 addsubmodule
+  0 weird white space submodule
+  updating bookmarks
+
+  $ rm -rf hg-repo6
+  $ cd git-repo6
+  $ git reset --hard 'HEAD^' > /dev/null
   $ cd ..
 
 test invalid splicemap1