]> git.ipfire.org Git - thirdparty/git.git/blob - t/t0068-for-each-repo.sh
Merge branch 'jc/do-not-just-explain-but-update-your-patch'
[thirdparty/git.git] / t / t0068-for-each-repo.sh
1 #!/bin/sh
2
3 test_description='git for-each-repo builtin'
4
5 . ./test-lib.sh
6
7 test_expect_success 'run based on configured value' '
8 git init one &&
9 git init two &&
10 git init three &&
11 git -C two commit --allow-empty -m "DID NOT RUN" &&
12 git config run.key "$TRASH_DIRECTORY/one" &&
13 git config --add run.key "$TRASH_DIRECTORY/three" &&
14 git for-each-repo --config=run.key commit --allow-empty -m "ran" &&
15 git -C one log -1 --pretty=format:%s >message &&
16 grep ran message &&
17 git -C two log -1 --pretty=format:%s >message &&
18 ! grep ran message &&
19 git -C three log -1 --pretty=format:%s >message &&
20 grep ran message &&
21 git for-each-repo --config=run.key -- commit --allow-empty -m "ran again" &&
22 git -C one log -1 --pretty=format:%s >message &&
23 grep again message &&
24 git -C two log -1 --pretty=format:%s >message &&
25 ! grep again message &&
26 git -C three log -1 --pretty=format:%s >message &&
27 grep again message
28 '
29
30 test_done