status: update short status to respect --no-ahead-behind
[gitweb.git] / t / t7400-submodule-basic.sh
index cf77a3a35747e40be6a8882d5bcdda498f4c4605..a39e69a3ebd1c39ddf8feb861f8a39c8315aa7f8 100755 (executable)
@@ -38,14 +38,12 @@ test_expect_success 'submodule update aborts on missing .gitmodules file' '
        test_i18ngrep "Submodule path .sub. not initialized" actual
 '
 
-test_expect_success 'configuration parsing' '
+test_expect_success 'submodule update aborts on missing gitmodules url' '
+       test_when_finished "git update-index --remove sub" &&
+       git update-index --add --cacheinfo 160000,$(git rev-parse HEAD),sub &&
        test_when_finished "rm -f .gitmodules" &&
-       cat >.gitmodules <<-\EOF &&
-       [submodule "s"]
-               path
-               ignore
-       EOF
-       test_must_fail git status
+       git config -f .gitmodules submodule.s.path sub &&
+       test_must_fail git submodule init
 '
 
 test_expect_success 'setup - repository in init subdirectory' '
@@ -273,6 +271,20 @@ test_expect_success 'submodule add with ./, /.. and // in path' '
        test_cmp empty untracked
 '
 
+test_expect_success !CYGWIN 'submodule add with \\ in path' '
+       test_when_finished "rm -rf parent sub\\with\\backslash" &&
+
+       # Initialize a repo with a backslash in its name
+       git init sub\\with\\backslash &&
+       touch sub\\with\\backslash/empty.file &&
+       git -C sub\\with\\backslash add empty.file &&
+       git -C sub\\with\\backslash commit -m "Added empty.file" &&
+
+       # Add that repository as a submodule
+       git init parent &&
+       git -C parent submodule add ../sub\\with\\backslash
+'
+
 test_expect_success 'submodule add in subdirectory' '
        echo "refs/heads/master" >expect &&
        >empty &&
@@ -1199,7 +1211,7 @@ test_expect_success 'clone --recurse-submodules with a pathspec works' '
 
        git clone --recurse-submodules="sub0" multisuper multisuper_clone &&
        git -C multisuper_clone submodule status |cut -c1,43- >actual &&
-       test_cmp actual expected
+       test_cmp expected actual
 '
 
 test_expect_success 'clone with multiple --recurse-submodules options' '
@@ -1267,4 +1279,10 @@ test_expect_success 'init properly sets the config' '
        test_must_fail git -C multisuper_clone config --get submodule.sub1.active
 '
 
+test_expect_success 'recursive clone respects -q' '
+       test_when_finished "rm -rf multisuper_clone" &&
+       git clone -q --recurse-submodules multisuper multisuper_clone >actual &&
+       test_must_be_empty actual
+'
+
 test_done