@@ -1297,7 +1297,7 @@ function e2e::sync_sha_once_sync_different_sha_unknown() {
12971297# #############################################
12981298# Test syncing after a crash
12991299# #############################################
1300- function e2e::sync_crash_cleanup_retry () {
1300+ function e2e::sync_crash_no_link_cleanup_retry () {
13011301 # First sync
13021302 echo " $FUNCNAME 1" > " $REPO /file"
13031303 git -C " $REPO " commit -qam " $FUNCNAME 1"
@@ -1325,6 +1325,37 @@ function e2e::sync_crash_cleanup_retry() {
13251325 assert_file_eq " $ROOT /link/file" " $FUNCNAME 1"
13261326}
13271327
1328+ # #############################################
1329+ # Test syncing after a crash
1330+ # #############################################
1331+ function e2e::sync_crash_no_worktree_cleanup_retry() {
1332+ # First sync
1333+ echo " $FUNCNAME 1" > " $REPO /file"
1334+ git -C " $REPO " commit -qam " $FUNCNAME 1"
1335+
1336+ GIT_SYNC \
1337+ --one-time \
1338+ --repo=" file://$REPO " \
1339+ --root=" $ROOT " \
1340+ --link=" link"
1341+ assert_link_exists " $ROOT /link"
1342+ assert_file_exists " $ROOT /link/file"
1343+ assert_file_eq " $ROOT /link/file" " $FUNCNAME 1"
1344+
1345+ # Corrupt it
1346+ rm -rf " $ROOT /.worktrees/"
1347+
1348+ # Try again
1349+ GIT_SYNC \
1350+ --one-time \
1351+ --repo=" file://$REPO " \
1352+ --root=" $ROOT " \
1353+ --link=" link"
1354+ assert_link_exists " $ROOT /link"
1355+ assert_file_exists " $ROOT /link/file"
1356+ assert_file_eq " $ROOT /link/file" " $FUNCNAME 1"
1357+ }
1358+
13281359# #############################################
13291360# Test changing repos with storage intact
13301361# #############################################
0 commit comments