topdir.mk: Make target git-import idempotent #129

Merged
Jan Lindemann merged 1 commit from jan/feature/20260928-topdir-mk-make-target-git-import-idempotent into master 2026-09-28 10:58:09 +02:00 AGit

2026-09-28

topdir.mk: Make target git-import idempotent
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m33s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 6m41s
CI / Packaging test (pull_request) Successful in 0s
CI / Packaging - Kali Linux (push) Successful in 5m32s
CI / Packaging - OpenSUSE Tumbleweed (push) Successful in 8m42s
CI / Packaging test (push) Successful in 0s
Target git-import adds everything it finds in the current directory. If
it's already a Git project, that fails over git commit -m "First commit".
Since it's a prerequisite of target git-init-remote, it breaks that target,
too for non-empty git repos, which isn't helpful when trying to run make
git-init-remote to publish an an already existing project.

So only do something meaningful in git-import if the project it's run in
doesn't already contain files.

Signed-off-by: Jan Lindemann <jan@janware.com>
2026-09-28 10:45:48 +02:00