diff --git a/askpass_git.sh b/askpass_git.sh index 27589cf..5a33a7c 100755 --- a/askpass_git.sh +++ b/askpass_git.sh @@ -14,6 +14,8 @@ if [ "$1" != "clone" ]; then exit $? fi +# `git credential fill` requires the repo url match to consume the credentials stored by git-sync. +# Askpass git only support repo started with "file://" which is used in test_e2e.sh. REPO=$(echo "$@" | grep -o "file://[^ ]*") PASSWD=$(echo "url=${REPO}" | git credential fill | grep -o "password=.*") # Test case much match the magic password below. diff --git a/test_e2e.sh b/test_e2e.sh index 8609248..baebdca 100755 --- a/test_e2e.sh +++ b/test_e2e.sh @@ -637,14 +637,13 @@ GIT_SYNC \ --password="I have no idea what the password is." \ --logtostderr \ --v=5 \ - --wait=0.1 \ + --one-time \ --repo="file://$REPO" \ --branch=master \ --rev=HEAD \ --root="$ROOT" \ --dest="link" \ - > "$DIR"/log."$TESTCASE" 2>&1 & -sleep 3 + > "$DIR"/log."$TESTCASE" 2>&1 # check for failure assert_file_absent "$ROOT"/link/file # run with askpass_git with correct password @@ -654,14 +653,13 @@ GIT_SYNC \ --password="Lov3!k0os" \ --logtostderr \ --v=5 \ - --wait=0.1 \ + --one-time \ --repo="file://$REPO" \ --branch=master \ --rev=HEAD \ --root="$ROOT" \ --dest="link" \ - > "$DIR"/log."$TESTCASE" 2>&1 & -sleep 3 + > "$DIR"/log."$TESTCASE" 2>&1 assert_link_exists "$ROOT"/link assert_file_exists "$ROOT"/link/file assert_file_eq "$ROOT"/link/file "$TESTCASE 1"