johnmehr / gitup

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

Scanning before cloning #92

Closed grahamperrin closed 11 months ago

grahamperrin commented 1 year ago
root@fuji:~ # time gitup -c ports
# Scanning local repository...
^C0.518u 0.189s 0:12.26 5.6%    67+165k 1157+0io 8pf+0w
You have new mail.
root@fuji:~ # 

If -c is to force a clone, then what's the purpose of a preceding scan?

I imagined forced removal, not a scan.

(Did I ^C abort too soon? Am I missing something?)

grahamperrin commented 1 year ago

With a manually forced removal:

root@fuji:~ # time rm -r /usr/ports/*
0.655u 17.045s 4:12.76 6.9%     10+169k 21175+0io 0pf+0w
root@fuji:~ # time gitup -c ports
# Scanning local repository...
# Host: git.freebsd.org
# Port: 443
# Repository Path: /ports.git
# Target Directory: /usr/ports
# Have: 3709a507f75c701e4da6844c28d69dc5047a87d3
# Want: 674dc7b4910df11ba2ec097dca68d3cbc883442e
# Branch: main
…
johnmehr commented 11 months ago

Sorry for dropping the ball on this one. I just added an update that should correct the behavior you're seeing. I'm a little leery about forced removals so gitup now aborts if a clone is attempted on a directory with files present.

johnmehr commented 11 months ago

If there are any problems with this new fix, please let me know. Thanks!