missing quotes in GIT_CREDENTIAL_ENV

echo without quotes removes newline, echo with quotes preserves it.

Previously failing test added
pull/572/head
Min RK 2019-01-31 10:48:18 +01:00
rodzic ff894f4404
commit a69145fcdd
2 zmienionych plików z 22 dodań i 1 usunięć

Wyświetl plik

@ -1,2 +1,2 @@
#!/bin/bash
echo -e $GIT_CREDENTIAL_ENV
echo -e "$GIT_CREDENTIAL_ENV"

Wyświetl plik

@ -0,0 +1,21 @@
"""Tests for docker bits"""
import os
from subprocess import check_output
repo_root = os.path.abspath(
os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)
)
def test_git_credential_env():
credential_env = "username=abc\npassword=def"
out = (
check_output(
os.path.join(repo_root, "docker", "git-credential-env"),
env={'GIT_CREDENTIAL_ENV': credential_env},
)
.decode()
.strip()
)
assert out == credential_env