Merge branch 'jk/validate-headref-fix' into maint
[gitweb.git] / t / t6120-describe.sh
index 38570f63bb8d55ce241f79bd8d8ff558d2ca5ecd..25110ea55d89656ab3fd4da525d4c94bc75840ac 100755 (executable)
@@ -237,4 +237,24 @@ test_expect_success 'describe --contains and --no-match' '
        test_cmp expect actual
 '
 
+test_expect_success 'setup and absorb a submodule' '
+       test_create_repo sub1 &&
+       test_commit -C sub1 initial &&
+       git submodule add ./sub1 &&
+       git submodule absorbgitdirs &&
+       git commit -a -m "add submodule" &&
+       git describe --dirty >expect &&
+       git describe --broken >out &&
+       test_cmp expect out
+'
+
+test_expect_success 'describe chokes on severely broken submodules' '
+       mv .git/modules/sub1/ .git/modules/sub_moved &&
+       test_must_fail git describe --dirty
+'
+test_expect_success 'describe ignoring a borken submodule' '
+       git describe --broken >out &&
+       grep broken out
+'
+
 test_done