|
1 | 1 | #!/usr/bin/env bash |
2 | 2 |
|
3 | | -# Set this locally for Windows: |
4 | | -git config core.autocrlf input |
5 | | - |
6 | 3 | set -e |
7 | 4 |
|
8 | | -# Set the GIT_SUBREPO_ROOT for testing. |
9 | | -source "$PWD"/.rc |
| 5 | +export LC_ALL=C.UTF-8 |
10 | 6 |
|
11 | 7 | # Get the location of this script |
12 | 8 | SCRIPT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd ) |
13 | 9 |
|
| 10 | +# Running tests depends on the whole project being git initialized. |
| 11 | +# So, git initialize the project, if necessary. |
| 12 | +if [ ! -d "${SCRIPT_DIR}/../.git" ]; then |
| 13 | + git init -b master . |
| 14 | + git config user.email "you@you" |
| 15 | + git config user.name "YouUser" |
| 16 | + git add . |
| 17 | + git commit -a -m"Initial commit" |
| 18 | + git config --list |
| 19 | +fi |
| 20 | + |
14 | 21 | BASHLIB=$( |
15 | | - find "$PWD"/ -type d -name bin -o -type d -name lib | tr '\n' ':' |
| 22 | + find "$PWD"/ -type d -name bin -o -type d -name lib | grep -v "\/\.pc\/" | tr '\n' ':' |
16 | 23 | ) |
17 | 24 | export BASHLIB |
18 | 25 |
|
@@ -46,17 +53,17 @@ clone-foo-and-bar() { |
46 | 53 | git clone "$UPSTREAM/foo" "$OWNER/foo" |
47 | 54 | ( |
48 | 55 | cd "$OWNER/foo" |
49 | | - git config core.autocrlf input |
50 | 56 | git config user.name "FooUser" |
51 | 57 | git config user.email "foo@foo" |
| 58 | + git config init.defaultBranch $DEFAULTBRANCH |
52 | 59 | ) |
53 | 60 | # bar will act as the subrepo |
54 | 61 | git clone "$UPSTREAM/bar" "$OWNER/bar" |
55 | 62 | ( |
56 | 63 | cd "$OWNER/bar" |
57 | | - git config core.autocrlf input |
58 | 64 | git config user.name "BarUser" |
59 | 65 | git config user.email "bar@bar" |
| 66 | + git config init.defaultBranch $DEFAULTBRANCH |
60 | 67 | ) |
61 | 68 | ) &> /dev/null || die |
62 | 69 | } |
|
0 commit comments