koordinates / kart

Distributed version-control for geospatial and tabular data
https://kartproject.org
Other
532 stars 41 forks source link

merge: Fix errors when setting author/committer from env vars #1022

Closed craigds closed 1 week ago

craigds commented 1 week ago

Description

I found an exception when trying to run kart merge with the author/committer set via env vars:

$ GIT_AUTHOR_NAME=a GIT_AUTHOR_EMAIL=a@example.com kart merge --no-ff --into=refs/heads/main --fail-on-conflict --output-format=json 3972f9fbe477575ec1169070ab849bf261b82fb0
kart helper: unhandled exception
Traceback (most recent call last):
  File "kart/helper.py", line 240, in helper
  File "click/core.py", line 1157, in __call__
  File "click/core.py", line 1078, in main
  File "kart/cli_util.py", line 72, in invoke
  File "click/core.py", line 1688, in invoke
  File "click/core.py", line 1434, in invoke
  File "click/core.py", line 783, in invoke
  File "click/decorators.py", line 33, in new_func
  File "kart/merge.py", line 403, in merge
  File "kart/merge.py", line 163, in do_merge
KeyError: "config value 'user.name' was not found"

This change fixes the issue and adds a test.

Related links:

Checklist: