diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-24 04:27:54 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-24 04:27:54 -0500 |
| commit | 94cc983944722157ab3b888a9bf27c9c9956cbd2 (patch) | |
| tree | c4c41b3641caad1ecd562b104642540cb10218a3 /scripts/setup-email.sh | |
| parent | 102af28f81e7389a309f671788076ae2c24c8f29 (diff) | |
| download | dotemacs-94cc983944722157ab3b888a9bf27c9c9956cbd2.tar.gz dotemacs-94cc983944722157ab3b888a9bf27c9c9956cbd2.zip | |
fix(vc): harden clipboard git-clone process and path handling
cj/git-clone-clipboard-url shelled out via shell-command and derived the clone directory with file-name-nondirectory, which mishandles scp-style SSH URLs with no slash (git@host:repo.git became git@host:repo). It also ran git in default-directory and only checked whether the clone dir appeared afterward, so a failed clone was silent.
The clone now runs as a direct git process (call-process, no shell) with clone -- url dir so a URL beginning with - cannot be read as a flag. The destination path comes from cj/--git-clone-dir-name, which takes the last component splitting on / and :, handling HTTPS, scp-style and ssh:// SSH, and local paths. It validates the clipboard is non-empty and the target is a writable directory that does not already contain the destination, and surfaces a non-zero git exit as a user-error with the *git-clone* output. Tests cover the deriver across URL schemes plus the empty-clipboard and clone-failure paths.
Diffstat (limited to 'scripts/setup-email.sh')
0 files changed, 0 insertions, 0 deletions
