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
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>
This commit is contained in:
parent
0bf9499df3
commit
1bab2573d0
1 changed files with 6 additions and 3 deletions
|
|
@ -224,9 +224,12 @@ git-clone-to-remote:
|
||||||
make git-update-project-description
|
make git-update-project-description
|
||||||
|
|
||||||
git-import: git-init git-config
|
git-import: git-init git-config
|
||||||
git add -A
|
if ! git ls-files | grep -q .; then \
|
||||||
git status
|
set -ex ;\
|
||||||
git commit -am "First commit"
|
git add -A ;\
|
||||||
|
git status ;\
|
||||||
|
git commit -am "First commit" ;\
|
||||||
|
fi
|
||||||
|
|
||||||
git-init-remote: git-import git-clone-to-remote
|
git-init-remote: git-import git-clone-to-remote
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue