From: sabadev Date: Mon, 12 Jul 2021 00:49:50 +0000 (-0400) Subject: Split prefix from filepath for ls-files. X-Git-Url: http://sabadev.xyz:4321/?a=commitdiff_plain;h=aa58fb00d2a4413ddb4d30f1cb326d8806848f67;p=git-skipper.git Split prefix from filepath for ls-files. --- diff --git a/git-skipper.rkt b/git-skipper.rkt index 2d7d35f..fe05ed3 100644 --- a/git-skipper.rkt +++ b/git-skipper.rkt @@ -6,7 +6,13 @@ (define (git . args) (string-split (with-output-to-string (λ () (system (string-join (cons "git" args))))) "\n")) -(define (ls-files arg) (git "ls-files" "-v" arg)) +(define (split-prefix str) + (define components (string-split str)) + (define prefix (car components)) + (define tail (string-join (list-tail components 1))) + (cons prefix tail)) + +(define (ls-files arg) (map split-prefix (git "ls-files" "-v" arg))) (define (modified-files) (ls-files "-m")) (modified-files)