From b832ab8184e16d22f533f077aaabc8df374c2c7b Mon Sep 17 00:00:00 2001 From: Hans Dijkema Date: Wed, 12 Aug 2026 16:04:04 +0200 Subject: [PATCH] Added add-porcelain --- main.rkt | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/main.rkt b/main.rkt index efc9398..3fb8bab 100644 --- a/main.rkt +++ b/main.rkt @@ -31,6 +31,12 @@ ) ) +(define (add-porcelain args . f) + (if (has-git-arg? args '--porcelain) + (if (null? f) args ((car f) args)) + (if (null? f) (cons '--porcelain args) + ((car f) (cons '--porcelain args))))) + (define-syntax def-cmd (syntax-rules () ((_ cmd cmd* cmd-sym) @@ -39,7 +45,9 @@ (def-cmd cmd cmd* cmd-sym pre-code std-process-git-result)) ((_ cmd cmd* cmd-sym pre-code process-result) (begin - (def-git-cmd-proxy cmd* cmd-sym pre-code process-result) + (def-git-cmd-proxy cmd* cmd-sym + pre-code + process-result) (define (cmd . args) (cmd* args)) (hash-set! git-commands cmd-sym cmd*))) ) @@ -76,9 +84,6 @@ (def-cmd git-commit cmd-git-commit 'commit (λ (args) (check-git-args 'commit args '((-m 1 "A commit message is mandatory")))) ) -(def-cmd git-push cmd-git-push 'push - (λ (args) (if (has-git-arg? args '--porcelain) - args - (cons '--porcelain args))) - ) +(def-cmd git-push cmd-git-push 'push add-porcelain) (def-cmd git-pull cmd-git-pull 'pull) +(def-cmd git-branch cmd-git-branch 'branch)