Added add-porcelain
This commit is contained in:
@@ -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
|
(define-syntax def-cmd
|
||||||
(syntax-rules ()
|
(syntax-rules ()
|
||||||
((_ cmd cmd* cmd-sym)
|
((_ cmd cmd* cmd-sym)
|
||||||
@@ -39,7 +45,9 @@
|
|||||||
(def-cmd cmd cmd* cmd-sym pre-code std-process-git-result))
|
(def-cmd cmd cmd* cmd-sym pre-code std-process-git-result))
|
||||||
((_ cmd cmd* cmd-sym pre-code process-result)
|
((_ cmd cmd* cmd-sym pre-code process-result)
|
||||||
(begin
|
(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))
|
(define (cmd . args) (cmd* args))
|
||||||
(hash-set! git-commands cmd-sym cmd*)))
|
(hash-set! git-commands cmd-sym cmd*)))
|
||||||
)
|
)
|
||||||
@@ -76,9 +84,6 @@
|
|||||||
(def-cmd git-commit cmd-git-commit 'commit
|
(def-cmd git-commit cmd-git-commit 'commit
|
||||||
(λ (args) (check-git-args 'commit args '((-m 1 "A commit message is mandatory"))))
|
(λ (args) (check-git-args 'commit args '((-m 1 "A commit message is mandatory"))))
|
||||||
)
|
)
|
||||||
(def-cmd git-push cmd-git-push 'push
|
(def-cmd git-push cmd-git-push 'push add-porcelain)
|
||||||
(λ (args) (if (has-git-arg? args '--porcelain)
|
|
||||||
args
|
|
||||||
(cons '--porcelain args)))
|
|
||||||
)
|
|
||||||
(def-cmd git-pull cmd-git-pull 'pull)
|
(def-cmd git-pull cmd-git-pull 'pull)
|
||||||
|
(def-cmd git-branch cmd-git-branch 'branch)
|
||||||
|
|||||||
Reference in New Issue
Block a user