Skip to content

Commit

Permalink
Merge pull request #648 from thockin/release-3.x
Browse files Browse the repository at this point in the history
V3 e2e: fix git submodules for file://
  • Loading branch information
k8s-ci-robot authored Nov 30, 2022
2 parents 482bf07 + e712435 commit bfad1e0
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions test_e2e.sh
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ function e2e::sync_tag() {
# First sync
echo "$FUNCNAME 1" > "$REPO"/file
git -C "$REPO" commit -qam "$FUNCNAME 1"
git -C "$REPO" tag -f "$TAG" >/dev/null
git -C "$REPO" tag -f "$TAG" -m "$TAG" >/dev/null

GIT_SYNC \
--wait=0.1 \
Expand All @@ -538,15 +538,15 @@ function e2e::sync_tag() {
# Add something and move the tag forward
echo "$FUNCNAME 2" > "$REPO"/file
git -C "$REPO" commit -qam "$FUNCNAME 2"
git -C "$REPO" tag -f "$TAG" >/dev/null
git -C "$REPO" tag -f "$TAG" -m "$TAG" >/dev/null
sleep 3
assert_link_exists "$ROOT"/link
assert_file_exists "$ROOT"/link/file
assert_file_eq "$ROOT"/link/file "$FUNCNAME 2"

# Move the tag backward
git -C "$REPO" reset -q --hard HEAD^
git -C "$REPO" tag -f "$TAG" >/dev/null
git -C "$REPO" tag -f "$TAG" -m "$TAG" >/dev/null
sleep 3
assert_link_exists "$ROOT"/link
assert_file_exists "$ROOT"/link/file
Expand Down Expand Up @@ -1560,7 +1560,7 @@ function e2e::submodule_sync_default() {
git -C "$NESTED_SUBMODULE" commit -aqm "init nested-submodule file"

# Add submodule
git -C "$REPO" submodule add -q file://$SUBMODULE
git -C "$REPO" -c protocol.file.allow=always submodule add -q file://$SUBMODULE
git -C "$REPO" commit -aqm "add submodule"

GIT_SYNC \
Expand All @@ -1579,7 +1579,7 @@ function e2e::submodule_sync_default() {
# Make change in submodule repo
echo "$FUNCNAME 2" > "$SUBMODULE"/submodule
git -C "$SUBMODULE" commit -qam "$FUNCNAME 2"
git -C "$REPO" submodule update --recursive --remote > /dev/null 2>&1
git -C "$REPO" -c protocol.file.allow=always submodule update --recursive --remote > /dev/null 2>&1
git -C "$REPO" commit -qam "$FUNCNAME 2"
sleep 3
assert_link_exists "$ROOT"/link
Expand All @@ -1589,7 +1589,7 @@ function e2e::submodule_sync_default() {

# Move backward in submodule repo
git -C "$SUBMODULE" reset -q --hard HEAD^
git -C "$REPO" submodule update --recursive --remote > /dev/null 2>&1
git -C "$REPO" -c protocol.file.allow=always submodule update --recursive --remote > /dev/null 2>&1
git -C "$REPO" commit -qam "$FUNCNAME 3"
sleep 3
assert_link_exists "$ROOT"/link
Expand All @@ -1598,9 +1598,9 @@ function e2e::submodule_sync_default() {
assert_file_eq "$ROOT"/link/$SUBMODULE_REPO_NAME/submodule "submodule"

# Add nested submodule to submodule repo
git -C "$SUBMODULE" submodule add -q file://$NESTED_SUBMODULE
git -C "$SUBMODULE" -c protocol.file.allow=always submodule add -q file://$NESTED_SUBMODULE
git -C "$SUBMODULE" commit -aqm "add nested submodule"
git -C "$REPO" submodule update --recursive --remote > /dev/null 2>&1
git -C "$REPO" -c protocol.file.allow=always submodule update --recursive --remote > /dev/null 2>&1
git -C "$REPO" commit -qam "$FUNCNAME 4"
sleep 3
assert_link_exists "$ROOT"/link
Expand All @@ -1614,7 +1614,7 @@ function e2e::submodule_sync_default() {
rm -rf "$SUBMODULE"/.git/modules/$NESTED_SUBMODULE_REPO_NAME
git -C "$SUBMODULE" rm -qf $NESTED_SUBMODULE_REPO_NAME
git -C "$SUBMODULE" commit -aqm "delete nested submodule"
git -C "$REPO" submodule update --recursive --remote > /dev/null 2>&1
git -C "$REPO" -c protocol.file.allow=always submodule update --recursive --remote > /dev/null 2>&1
git -C "$REPO" commit -qam "$FUNCNAME 5"
sleep 3
assert_link_exists "$ROOT"/link
Expand Down Expand Up @@ -1651,7 +1651,7 @@ function e2e::submodule_sync_depth() {
echo "$FUNCNAME 1" > "$SUBMODULE"/submodule
git -C "$SUBMODULE" add submodule
git -C "$SUBMODULE" commit -aqm "submodule $FUNCNAME 1"
git -C "$REPO" submodule add -q file://$SUBMODULE
git -C "$REPO" -c protocol.file.allow=always submodule add -q file://$SUBMODULE
git -C "$REPO" config -f "$REPO"/.gitmodules submodule.$SUBMODULE_REPO_NAME.shallow true
git -C "$REPO" commit -qam "$FUNCNAME 1"

Expand Down Expand Up @@ -1679,7 +1679,7 @@ function e2e::submodule_sync_depth() {
# Move forward
echo "$FUNCNAME 2" > "$SUBMODULE"/submodule
git -C "$SUBMODULE" commit -aqm "submodule $FUNCNAME 2"
git -C "$REPO" submodule update --recursive --remote > /dev/null 2>&1
git -C "$REPO" -c protocol.file.allow=always submodule update --recursive --remote > /dev/null 2>&1
git -C "$REPO" commit -qam "$FUNCNAME 2"
sleep 3
assert_link_exists "$ROOT"/link
Expand All @@ -1696,7 +1696,7 @@ function e2e::submodule_sync_depth() {

# Move backward
git -C "$SUBMODULE" reset -q --hard HEAD^
git -C "$REPO" submodule update --recursive --remote > /dev/null 2>&1
git -C "$REPO" -c protocol.file.allow=always submodule update --recursive --remote > /dev/null 2>&1
git -C "$REPO" commit -qam "$FUNCNAME 3"
sleep 3
assert_link_exists "$ROOT"/link
Expand Down Expand Up @@ -1728,7 +1728,7 @@ function e2e::submodule_sync_off() {
git -C "$SUBMODULE" commit -aqm "init submodule file"

# Add submodule
git -C "$REPO" submodule add -q file://$SUBMODULE
git -C "$REPO" -c protocol.file.allow=always submodule add -q file://$SUBMODULE
git -C "$REPO" commit -aqm "add submodule"

GIT_SYNC \
Expand Down Expand Up @@ -1767,11 +1767,11 @@ function e2e::submodule_sync_shallow() {
echo "nested-submodule" > "$NESTED_SUBMODULE"/nested-submodule
git -C "$NESTED_SUBMODULE" add nested-submodule
git -C "$NESTED_SUBMODULE" commit -aqm "init nested-submodule file"
git -C "$SUBMODULE" submodule add -q file://$NESTED_SUBMODULE
git -C "$SUBMODULE" -c protocol.file.allow=always submodule add -q file://$NESTED_SUBMODULE
git -C "$SUBMODULE" commit -aqm "add nested submodule"

# Add submodule
git -C "$REPO" submodule add -q file://$SUBMODULE
git -C "$REPO" -c protocol.file.allow=always submodule add -q file://$SUBMODULE
git -C "$REPO" commit -aqm "add submodule"

GIT_SYNC \
Expand Down

0 comments on commit bfad1e0

Please sign in to comment.