johnmehr / gitup

A minimalist, dependency-free FreeBSD program to clone/pull Git repositories.
BSD 2-Clause "Simplified" License
51 stars 9 forks source link

gitup chokes on unrelated .git directory #88

Closed michael-o closed 1 year ago

michael-o commented 1 year ago

Output:

root@bsd1srv:~
# gitup ports && gitup src
# Scanning local repository...
gitup: A .git directory was found -- gitup does not update this directory which will cause problems for the official Git client.  If you wish to use gitup, please remove /usr/ports/www/py-html5lib/work-py37/html5lib-1.0.1/html5lib/tests/testdata/.git and rerun gitup.: File exists

with

root@bsd1srv:~
# gitup -V
gitup version 0.98

I'd expect that gitup checks only at the root of the target directory, but not everywhere.

johnmehr commented 1 year ago

This should be fixed now. Thanks!

michael-o commented 1 year ago

Will test tomorrow!

michael-o commented 1 year ago

Interesting:

root@deblndw013x3j:/usr/ports/www/py-html5lib
# find . -name .git -type d
root@deblndw013x3j:/usr/ports/www/py-html5lib
# find . -name .git -type f
./work-py37/html5lib-1.0.1/html5lib/tests/testdata/.git
root@deblndw013x3j:/usr/ports/www/py-html5lib
# cat ./work-py37/html5lib-1.0.1/html5lib/tests/testdata/.git
gitdir: ../../../../html5lib-python/.git/worktrees/html5lib-python-b/modules/testdata

So I guess you should check for dir as well, just to make sure.

But I can confirm that a new gitup run does not print the warning. So issue is fixed.