exit code checking added
This commit is contained in:
@@ -57,26 +57,29 @@
|
||||
(λ (args) (if (has-git-arg? args '-s)
|
||||
args
|
||||
(cons '-s args)))
|
||||
(λ (cmd result output out)
|
||||
(if result
|
||||
(map (λ (line)
|
||||
(let* ((state (string->symbol (string-trim (substring line 0 2))))
|
||||
(file (string-trim (substring line 3))))
|
||||
(cond
|
||||
([eq? state '??] (list 'new file))
|
||||
([eq? state 'M] (list 'modified file))
|
||||
([eq? state 'A] (list 'added file))
|
||||
([eq? state 'D] (list 'deleted file))
|
||||
([eq? state 'AM] (list 'modified file))
|
||||
([eq? state 'AD] (list 'deleted file))
|
||||
([eq? state 'MM] (list 'modified file))
|
||||
([eq? state 'MD] (list 'deleted file))
|
||||
(else
|
||||
(git-error 'status "Unexpected state" state))
|
||||
)
|
||||
))
|
||||
out)
|
||||
(git-error 'status "Error" output)))
|
||||
(λ (cmd exit-code result output out)
|
||||
(if (= exit-code 0)
|
||||
(if result
|
||||
(map (λ (line)
|
||||
(let* ((state (string->symbol (string-trim (substring line 0 2))))
|
||||
(file (string-trim (substring line 3))))
|
||||
(cond
|
||||
([eq? state '??] (list 'new file))
|
||||
([eq? state 'M] (list 'modified file))
|
||||
([eq? state 'A] (list 'added file))
|
||||
([eq? state 'D] (list 'deleted file))
|
||||
([eq? state 'AM] (list 'modified file))
|
||||
([eq? state 'AD] (list 'deleted file))
|
||||
([eq? state 'MM] (list 'modified file))
|
||||
([eq? state 'MD] (list 'deleted file))
|
||||
(else
|
||||
(git-error 'status "Unexpected state" state))
|
||||
)
|
||||
))
|
||||
out)
|
||||
(git-error 'status "Error" output))
|
||||
(git-error 'status "Exitcode <> 0" (cons (format "~a\n" exit-code) output))
|
||||
))
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user