From aa58fb00d2a4413ddb4d30f1cb326d8806848f67 Mon Sep 17 00:00:00 2001 From: sabadev Date: Sun, 11 Jul 2021 20:49:50 -0400 Subject: [PATCH] Split prefix from filepath for ls-files. --- git-skipper.rkt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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) -- 2.20.1