File tree Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Expand file tree Collapse file tree 1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -1491,6 +1491,40 @@ function e2e::sync_crash_no_worktree_cleanup_retry() {
1491
1491
assert_file_eq " $ROOT /link/file" " ${FUNCNAME[0]} "
1492
1492
}
1493
1493
1494
+ # #############################################
1495
+ # Test syncing if a file named for the SHA exists
1496
+ # #############################################
1497
+ function e2e::sync_sha_shafile_exists() {
1498
+ echo " ${FUNCNAME[0]} 1" > " $REPO /file"
1499
+ git -C " $REPO " commit -qam " ${FUNCNAME[0]} 1"
1500
+ SHA1=$( git -C " $REPO " rev-list -n1 HEAD)
1501
+ echo " ${FUNCNAME[0]} 2" > " $REPO /file"
1502
+ git -C " $REPO " commit -qam " ${FUNCNAME[0]} 2"
1503
+ SHA2=$( git -C " $REPO " rev-list -n1 HEAD)
1504
+
1505
+ GIT_SYNC \
1506
+ --one-time \
1507
+ --repo=" file://$REPO " \
1508
+ --ref=" $SHA1 " \
1509
+ --root=" $ROOT " \
1510
+ --link=" link"
1511
+ assert_link_exists " $ROOT /link"
1512
+ assert_file_exists " $ROOT /link/file"
1513
+ assert_file_eq " $ROOT /link/file" " ${FUNCNAME[0]} 1"
1514
+
1515
+ touch " $ROOT /$SHA2 "
1516
+
1517
+ GIT_SYNC \
1518
+ --one-time \
1519
+ --repo=" file://$REPO " \
1520
+ --ref=" $SHA2 " \
1521
+ --root=" $ROOT " \
1522
+ --link=" link"
1523
+ assert_link_exists " $ROOT /link"
1524
+ assert_file_exists " $ROOT /link/file"
1525
+ assert_file_eq " $ROOT /link/file" " ${FUNCNAME[0]} 2"
1526
+ }
1527
+
1494
1528
# #############################################
1495
1529
# Test changing repos with storage intact
1496
1530
# #############################################
You can’t perform that action at this time.
0 commit comments