added test for same SHA and filename
This commit is contained in:
parent
21fce7f2a1
commit
7d9699e5fc
34
test_e2e.sh
34
test_e2e.sh
|
|
@ -1491,6 +1491,40 @@ function e2e::sync_crash_no_worktree_cleanup_retry() {
|
|||
assert_file_eq "$ROOT/link/file" "${FUNCNAME[0]}"
|
||||
}
|
||||
|
||||
##############################################
|
||||
# Test syncing if a file named for the SHA exists
|
||||
##############################################
|
||||
function e2e::sync_sha_shafile_exists() {
|
||||
echo "${FUNCNAME[0]} 1" > "$REPO/file"
|
||||
git -C "$REPO" commit -qam "${FUNCNAME[0]} 1"
|
||||
SHA1=$(git -C "$REPO" rev-list -n1 HEAD)
|
||||
echo "${FUNCNAME[0]} 2" > "$REPO/file"
|
||||
git -C "$REPO" commit -qam "${FUNCNAME[0]} 2"
|
||||
SHA2=$(git -C "$REPO" rev-list -n1 HEAD)
|
||||
|
||||
GIT_SYNC \
|
||||
--one-time \
|
||||
--repo="file://$REPO" \
|
||||
--ref="$SHA1" \
|
||||
--root="$ROOT" \
|
||||
--link="link"
|
||||
assert_link_exists "$ROOT/link"
|
||||
assert_file_exists "$ROOT/link/file"
|
||||
assert_file_eq "$ROOT/link/file" "${FUNCNAME[0]} 1"
|
||||
|
||||
touch "$ROOT/$SHA2"
|
||||
|
||||
GIT_SYNC \
|
||||
--one-time \
|
||||
--repo="file://$REPO" \
|
||||
--ref="$SHA2" \
|
||||
--root="$ROOT" \
|
||||
--link="link"
|
||||
assert_link_exists "$ROOT/link"
|
||||
assert_file_exists "$ROOT/link/file"
|
||||
assert_file_eq "$ROOT/link/file" "${FUNCNAME[0]} 2"
|
||||
}
|
||||
|
||||
##############################################
|
||||
# Test changing repos with storage intact
|
||||
##############################################
|
||||
|
|
|
|||
Loading…
Reference in New Issue