]> Pileus Git - ~andy/git/commitdiff
Merge branch 'fg/submodule-clone-depth'
authorJunio C Hamano <gitster@pobox.com>
Mon, 15 Jul 2013 17:28:48 +0000 (10:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 15 Jul 2013 17:28:48 +0000 (10:28 -0700)
Allow shallow-cloning of submodules with "git submodule update".

* fg/submodule-clone-depth:
  Add --depth to submodule update/add

1  2 
Documentation/git-submodule.txt
git-submodule.sh
t/t7400-submodule-basic.sh
t/t7406-submodule-update.sh

Simple merge
Simple merge
index 50e6ad7458c48842408e2afc20f84c117120c262,42cd6de463a108b073be23cadc8bb4ada7d2847a..5ee97b003a879a0b6a558265e94c18582aa836c0
@@@ -948,19 -868,19 +948,35 @@@ test_expect_success 'submodule deinit f
        test -n "$(git config --get-regexp "submodule\.example\.")"
  '
  
 +test_expect_success 'submodule with UTF-8 name' '
 +      svname=$(printf "\303\245 \303\244\303\266") &&
 +      mkdir "$svname" &&
 +      (
 +              cd "$svname" &&
 +              git init &&
 +              >sub &&
 +              git add sub &&
 +              git commit -m "init sub"
 +      ) &&
 +      test_config core.precomposeunicode true &&
 +      git submodule add ./"$svname" &&
 +      git submodule >&2 &&
 +      test -n "$(git submodule | grep "$svname")"
 +'
++
+ test_expect_success 'submodule add clone shallow submodule' '
+       mkdir super &&
+       pwd=$(pwd)
+       (
+               cd super &&
+               git init &&
+               git submodule add --depth=1 file://"$pwd"/example2 submodule &&
+               (
+                       cd submodule &&
+                       test 1 = $(git log --oneline | wc -l)
+               )
+       )
+ '
  test_done
Simple merge