@@ -197,17 +197,6 @@ function clean_work() {
197
197
mkdir -p " $WORK "
198
198
}
199
199
200
- # config_repo sets required git config, so we don't depend on (shared) global git config.
201
- #
202
- # Args:
203
- # $1: directory of git repo
204
- function config_repo() {
205
- local repo=$1
206
-
207
- git -C " $repo " config user.email " git-sync-test@example.com"
208
- git -C " $repo " config user.name " git-sync-test"
209
- }
210
-
211
200
# REPO and REPO2 are the source repos under test.
212
201
REPO=" $DIR /repo"
213
202
REPO2=" ${REPO} 2"
@@ -218,7 +207,6 @@ function init_repo() {
218
207
rm -rf " $REPO "
219
208
mkdir -p " $REPO "
220
209
git -C " $REPO " init -q -b " $MAIN_BRANCH "
221
- config_repo " $REPO "
222
210
echo " $arg " > " $REPO /file"
223
211
git -C " $REPO " add file
224
212
git -C " $REPO " commit -aqm " init file"
@@ -394,7 +382,6 @@ function e2e::init_root_is_under_another_repo() {
394
382
mkdir -p " $ROOT /subdir/root"
395
383
date > " $ROOT /subdir/root/file" # so it is not empty
396
384
git -C " $ROOT /subdir" init -q
397
- config_repo " $ROOT /subdir"
398
385
399
386
GIT_SYNC \
400
387
--one-time \
@@ -412,7 +399,6 @@ function e2e::init_root_is_under_another_repo() {
412
399
function e2e::init_root_fails_sanity() {
413
400
# Make an invalid git repo.
414
401
git -C " $ROOT " init -q
415
- config_repo " $ROOT "
416
402
echo " ref: refs/heads/nonexist" > " $ROOT /.git/HEAD"
417
403
418
404
GIT_SYNC \
@@ -2473,7 +2459,6 @@ function e2e::submodule_sync_default() {
2473
2459
mkdir " $SUBMODULE "
2474
2460
2475
2461
git -C " $SUBMODULE " init -q -b " $MAIN_BRANCH "
2476
- config_repo " $SUBMODULE "
2477
2462
echo " submodule" > " $SUBMODULE /submodule.file"
2478
2463
git -C " $SUBMODULE " add submodule.file
2479
2464
git -C " $SUBMODULE " commit -aqm " init submodule.file"
@@ -2484,7 +2469,6 @@ function e2e::submodule_sync_default() {
2484
2469
mkdir " $NESTED_SUBMODULE "
2485
2470
2486
2471
git -C " $NESTED_SUBMODULE " init -q -b " $MAIN_BRANCH "
2487
- config_repo " $NESTED_SUBMODULE "
2488
2472
echo " nested-submodule" > " $NESTED_SUBMODULE /nested-submodule.file"
2489
2473
git -C " $NESTED_SUBMODULE " add nested-submodule.file
2490
2474
git -C " $NESTED_SUBMODULE " commit -aqm " init nested-submodule.file"
@@ -2581,7 +2565,6 @@ function e2e::submodule_sync_depth() {
2581
2565
mkdir " $SUBMODULE "
2582
2566
2583
2567
git -C " $SUBMODULE " init -q -b " $MAIN_BRANCH "
2584
- config_repo " $SUBMODULE "
2585
2568
2586
2569
# First sync
2587
2570
expected_depth=" 1"
@@ -2662,7 +2645,6 @@ function e2e::submodule_sync_off() {
2662
2645
mkdir " $SUBMODULE "
2663
2646
2664
2647
git -C " $SUBMODULE " init -q -b " $MAIN_BRANCH "
2665
- config_repo " $SUBMODULE "
2666
2648
echo " submodule" > " $SUBMODULE /submodule.file"
2667
2649
git -C " $SUBMODULE " add submodule.file
2668
2650
git -C " $SUBMODULE " commit -aqm " init submodule file"
@@ -2693,7 +2675,6 @@ function e2e::submodule_sync_shallow() {
2693
2675
mkdir " $SUBMODULE "
2694
2676
2695
2677
git -C " $SUBMODULE " init -q -b " $MAIN_BRANCH "
2696
- config_repo " $SUBMODULE "
2697
2678
echo " submodule" > " $SUBMODULE /submodule.file"
2698
2679
git -C " $SUBMODULE " add submodule.file
2699
2680
git -C " $SUBMODULE " commit -aqm " init submodule file"
@@ -2704,7 +2685,6 @@ function e2e::submodule_sync_shallow() {
2704
2685
mkdir " $NESTED_SUBMODULE "
2705
2686
2706
2687
git -C " $NESTED_SUBMODULE " init -q -b " $MAIN_BRANCH "
2707
- config_repo " $NESTED_SUBMODULE "
2708
2688
echo " nested-submodule" > " $NESTED_SUBMODULE /nested-submodule.file"
2709
2689
git -C " $NESTED_SUBMODULE " add nested-submodule.file
2710
2690
git -C " $NESTED_SUBMODULE " commit -aqm " init nested-submodule file"
@@ -2741,7 +2721,6 @@ function e2e::submodule_sync_relative() {
2741
2721
mkdir " $SUBMODULE "
2742
2722
2743
2723
git -C " $SUBMODULE " init -q -b " $MAIN_BRANCH "
2744
- config_repo " $SUBMODULE "
2745
2724
echo " submodule" > " $SUBMODULE /submodule.file"
2746
2725
git -C " $SUBMODULE " add submodule.file
2747
2726
git -C " $SUBMODULE " commit -aqm " init submodule file"
@@ -2778,7 +2757,6 @@ function e2e::submodule_sync_over_ssh_different_keys() {
2778
2757
mkdir " $NESTED_SUBMODULE "
2779
2758
2780
2759
git -C " $NESTED_SUBMODULE " init -q -b " $MAIN_BRANCH "
2781
- config_repo " $NESTED_SUBMODULE "
2782
2760
echo " nested-submodule" > " $NESTED_SUBMODULE /nested-submodule.file"
2783
2761
git -C " $NESTED_SUBMODULE " add nested-submodule.file
2784
2762
git -C " $NESTED_SUBMODULE " commit -aqm " init nested-submodule.file"
@@ -2799,7 +2777,6 @@ function e2e::submodule_sync_over_ssh_different_keys() {
2799
2777
mkdir " $SUBMODULE "
2800
2778
2801
2779
git -C " $SUBMODULE " init -q -b " $MAIN_BRANCH "
2802
- config_repo " $SUBMODULE "
2803
2780
echo " submodule" > " $SUBMODULE /submodule.file"
2804
2781
git -C " $SUBMODULE " add submodule.file
2805
2782
git -C " $SUBMODULE " commit -aqm " init submodule.file"
@@ -2858,7 +2835,6 @@ function e2e::submodule_sync_over_http_different_passwords() {
2858
2835
mkdir " $NESTED_SUBMODULE "
2859
2836
2860
2837
git -C " $NESTED_SUBMODULE " init -q -b " $MAIN_BRANCH "
2861
- config_repo " $NESTED_SUBMODULE "
2862
2838
echo " nested-submodule" > " $NESTED_SUBMODULE /nested-submodule.file"
2863
2839
git -C " $NESTED_SUBMODULE " add nested-submodule.file
2864
2840
git -C " $NESTED_SUBMODULE " commit -aqm " init nested-submodule.file"
@@ -2877,7 +2853,6 @@ function e2e::submodule_sync_over_http_different_passwords() {
2877
2853
mkdir " $SUBMODULE "
2878
2854
2879
2855
git -C " $SUBMODULE " init -q -b " $MAIN_BRANCH "
2880
- config_repo " $SUBMODULE "
2881
2856
echo " submodule" > " $SUBMODULE /submodule.file"
2882
2857
git -C " $SUBMODULE " add submodule.file
2883
2858
git -C " $SUBMODULE " commit -aqm " init submodule.file"
@@ -3399,6 +3374,8 @@ function run_test() {
3399
3374
# Override local configs for predictability in this test.
3400
3375
export GIT_CONFIG_GLOBAL=" $DIR /gitconfig"
3401
3376
export GIT_CONFIG_SYSTEM=/dev/null
3377
+ git config --global user.email " git-sync-test@example.com"
3378
+ git config --global user.name " git-sync-test"
3402
3379
3403
3380
# Make sure files we create can be group writable.
3404
3381
umask 0002
0 commit comments