interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t7414-submodule-mistakes.sh

39 lines · 1033 bytes Raw Blame History
1#!/bin/sh
2
3test_description='handling of common mistakes people may make with submodules'
4
5. ./test-lib.sh
6
7test_expect_success 'create embedded repository' '
8 git init embed &&
9 test_commit -C embed one
10'
11
12test_expect_success 'git-add on embedded repository warns' '
13 test_when_finished "git rm --cached -f embed" &&
14 git add embed 2>stderr &&
15 test_grep warning stderr
16'
17
18test_expect_success '--no-warn-embedded-repo suppresses warning' '
19 test_when_finished "git rm --cached -f embed" &&
20 git add --no-warn-embedded-repo embed 2>stderr &&
21 test_grep ! warning stderr
22'
23
24test_expect_success 'no warning when updating entry' '
25 test_when_finished "git rm --cached -f embed" &&
26 git add embed &&
27 git -C embed commit --allow-empty -m two &&
28 git add embed 2>stderr &&
29 test_grep ! warning stderr
30'
31
32test_expect_success 'submodule add does not warn' '
33 test_when_finished "git rm -rf submodule .gitmodules" &&
34 git -c protocol.file.allow=always \
35 submodule add ./embed submodule 2>stderr &&
36 test_grep ! warning stderr
37'
38
39test_done