@@ -56,9 +56,9 @@ function finish() {
5656
5757trap finish INT EXIT
5858
59- # ### #####################
59+ # #####################
6060# main
61- # ### #####################
61+ # #####################
6262
6363# Build it
6464make container REGISTRY=e2e TAG=$( make -s version)
@@ -248,6 +248,52 @@ TAG="$TESTCASE"--TAG
248248# First sync
249249echo " $TESTCASE 1" > " $REPO " /file
250250git -C " $REPO " commit -qam " $TESTCASE 1"
251+ git -C " $REPO " tag -f " $TAG " > /dev/null
252+ GIT_SYNC \
253+ --logtostderr \
254+ --v=5 \
255+ --wait=0.1 \
256+ --repo=" $REPO " \
257+ --rev=" $TAG " \
258+ --root=" $ROOT " \
259+ --dest=" link" > " $DIR " /log." $TESTCASE " 2>&1 &
260+ sleep 3
261+ assert_link_exists " $ROOT " /link
262+ assert_file_exists " $ROOT " /link/file
263+ assert_file_eq " $ROOT " /link/file " $TESTCASE 1"
264+ # Add something and move the tag forward
265+ echo " $TESTCASE 2" > " $REPO " /file
266+ git -C " $REPO " commit -qam " $TESTCASE 2"
267+ git -C " $REPO " tag -f " $TAG " > /dev/null
268+ sleep 3
269+ assert_link_exists " $ROOT " /link
270+ assert_file_exists " $ROOT " /link/file
271+ assert_file_eq " $ROOT " /link/file " $TESTCASE 2"
272+ # Move the tag backward
273+ git -C " $REPO " reset -q --hard HEAD^
274+ git -C " $REPO " tag -f " $TAG " > /dev/null
275+ sleep 3
276+ assert_link_exists " $ROOT " /link
277+ assert_file_exists " $ROOT " /link/file
278+ assert_file_eq " $ROOT " /link/file " $TESTCASE 1"
279+ # Add something after the tag
280+ echo " $TESTCASE 3" > " $REPO " /file
281+ git -C " $REPO " commit -qam " $TESTCASE 3"
282+ sleep 3
283+ assert_link_exists " $ROOT " /link
284+ assert_file_exists " $ROOT " /link/file
285+ assert_file_eq " $ROOT " /link/file " $TESTCASE 1"
286+ # Wrap up
287+ remove_sync_container
288+ wait
289+ pass
290+
291+ # Test tag syncing with annotated tags
292+ testcase " tag-sync-annotated"
293+ TAG=" $TESTCASE " --TAG
294+ # First sync
295+ echo " $TESTCASE 1" > " $REPO " /file
296+ git -C " $REPO " commit -qam " $TESTCASE 1"
251297git -C " $REPO " tag -af " $TAG " -m " $TESTCASE 1" > /dev/null
252298GIT_SYNC \
253299 --logtostderr \
0 commit comments