183
183
check_copybara_rev_id " $destination " " $second_commit "
184
184
185
185
( cd $destination || return
186
- run_git show $primary > $TEST_log
186
+ run_git --git-dir= " $destination " show $primary > $TEST_log
187
187
)
188
188
189
189
expect_log " -first version for drink"
228
228
check_copybara_rev_id " $destination " " $commit_three "
229
229
230
230
( cd $destination || return
231
- run_git log " ${primary} ~1..${primary} " > $TEST_log
231
+ run_git --git-dir= " $destination " log " ${primary} ~1..${primary} " > $TEST_log
232
232
)
233
233
expect_not_log " commit two"
234
234
expect_log " commit three"
@@ -238,12 +238,12 @@ EOF
238
238
check_copybara_rev_id " $destination " " $commit_five "
239
239
240
240
( cd $destination || return
241
- run_git log " ${primary} ~2..${primary} ~1" > $TEST_log
241
+ run_git --git-dir= " $destination " log " ${primary} ~2..${primary} ~1" > $TEST_log
242
242
)
243
243
expect_log " commit four"
244
244
245
245
( cd $destination || return
246
- run_git log " ${primary} ~1..${primary} " > $TEST_log
246
+ run_git --git-dir= " $destination " log " ${primary} ~1..${primary} " > $TEST_log
247
247
)
248
248
expect_log " commit five"
249
249
381
381
expect_log
" .*${commit_five: 0: 10} .*commit five.*Bara Kopi <[email protected] >.*"
382
382
383
383
( cd $destination || return
384
- run_git " log" " ${primary} ~1..${primary} " > $TEST_log
384
+ run_git --git-dir= " $destination " " log" " ${primary} ~1..${primary} " > $TEST_log
385
385
)
386
386
# By default we include the whole history if last_rev cannot be found. --squash-without-history
387
387
# can be used for disabling this.
397
397
check_copybara_rev_id " $destination " " $commit_four "
398
398
399
399
( cd $destination || return
400
- run_git log " ${primary} ~1..${primary} " > $TEST_log
400
+ run_git --git-dir= " $destination " log " ${primary} ~1..${primary} " > $TEST_log
401
401
)
402
402
# "commit one" should not be included because it was migrated before
403
403
expect_not_log " commit one"
411
411
check_copybara_rev_id " $destination " " $commit_five "
412
412
413
413
( cd $destination || return
414
- run_git log " ${primary} ~1..${primary} " > $TEST_log
414
+ run_git --git-dir= " $destination " log " ${primary} ~1..${primary} " > $TEST_log
415
415
)
416
416
# We are forcing to use commit_three as the last migration. This has
417
417
# no effect in squash workflow but it changes the release notes.
460
460
check_copybara_rev_id " $destination " " $commit_three "
461
461
462
462
( cd $destination || return
463
- run_git log > $TEST_log
463
+ run_git --git-dir= " $destination " log > $TEST_log
464
464
)
465
465
expect_log " commit one"
466
466
expect_not_log " commit two"
@@ -471,8 +471,7 @@ function empty_git_bare_repo() {
471
471
repo=$( temp_dir repo)
472
472
cd $repo || return
473
473
run_git init . --bare > $TEST_log 2>&1 || fail " Cannot create repo"
474
- run_git --work-tree=" $( mktemp -d) " commit --allow-empty -m " Empty repo" \
475
- > $TEST_log 2>&1 || fail " Cannot commit to empty repo"
474
+ run_git --git-dir=" $repo " --work-tree=" $( mktemp -d) " commit --allow-empty -m " Empty repo"
476
475
echo $repo
477
476
}
478
477
@@ -923,7 +922,6 @@ function test_command_copybara_filename_no_correct_name() {
923
922
function setup_reversible_check_workflow() {
924
923
remote=$( temp_dir remote)
925
924
destination=$( empty_git_bare_repo)
926
-
927
925
pushd $remote || return
928
926
run_git init .
929
927
echo " Is the reverse of the reverse forward?" > test.txt
@@ -1334,7 +1332,7 @@ EOF
1334
1332
check_copybara_rev_id " $destination " " $commit_one "
1335
1333
1336
1334
( cd $destination || return
1337
- run_git log > $TEST_log
1335
+ run_git --git-dir= " $destination " log > $TEST_log
1338
1336
)
1339
1337
expect_log " c1 foooo destination/[a-f0-9]\{1,\} bar"
1340
1338
}
0 commit comments