diff --git a/.dockerignore b/.dockerignore index f4c91a47..08408d22 100644 --- a/.dockerignore +++ b/.dockerignore @@ -5,10 +5,12 @@ __pycache__/ .mypy_cache/ .pytest_cache/ .github/ -.git/ .pdm-build/ .pdm-python .eggs/ +.git/ +!.git/HEAD +!.git/refs/heads/* venv/ .venv/ diff --git a/archivebox/config.py b/archivebox/config.py index ecdc46be..f32034ce 100644 --- a/archivebox/config.py +++ b/archivebox/config.py @@ -399,7 +399,7 @@ def get_version(config): def get_commit_hash(config) -> Optional[str]: try: - git_dir = config['PACKAGE_DIR'] / '../' + git_dir = config['PACKAGE_DIR'] / '../.git' ref = (git_dir / 'HEAD').read_text().strip().split(' ')[-1] commit_hash = git_dir.joinpath(ref).read_text().strip() return commit_hash