better progress information for git commands
This commit is contained in:
+14
-3
@@ -60,7 +60,7 @@
|
||||
(lambda (out) (displayln "changed" out)))
|
||||
(define worktree-diff (git 'diff))
|
||||
(check-true (regexp-match? #rx"-hello" worktree-diff))
|
||||
(check-true (regexp-match? #rx"\+changed" worktree-diff))
|
||||
(check-true (regexp-match? #rx"[+]changed" worktree-diff))
|
||||
(check-equal? (git 'diff '--cached) "")
|
||||
|
||||
(define diff-output (open-output-string))
|
||||
@@ -72,7 +72,7 @@
|
||||
(check-equal? (git 'diff) "")
|
||||
(define cached-diff (git 'diff '--cached))
|
||||
(check-true (regexp-match? #rx"-hello" cached-diff))
|
||||
(check-true (regexp-match? #rx"\+changed" cached-diff))
|
||||
(check-true (regexp-match? #rx"[+]changed" cached-diff))
|
||||
(git 'commit "prepare branches")
|
||||
|
||||
(git 'checkout '-b "work")
|
||||
@@ -84,10 +84,21 @@
|
||||
(check-equal? (file->string (build-path "sub" "hello.txt")) "work\n")
|
||||
|
||||
(git 'checkout "master")
|
||||
(check-equal? (file->string (build-path "sub" "hello.txt")) "hello\n")
|
||||
(check-equal? (file->string (build-path "sub" "hello.txt")) "changed\n")
|
||||
(check-equal? (git-current-branch) "master")
|
||||
(check-not-false (member "work" (git 'branch)))
|
||||
|
||||
;; Safe checkout must not overwrite an uncommitted tracked change.
|
||||
(call-with-output-file (build-path "sub" "hello.txt")
|
||||
#:exists 'truncate/replace
|
||||
(lambda (out) (displayln "dirty" out)))
|
||||
(check-exn exn:fail? (lambda () (git 'checkout "work")))
|
||||
(check-equal? (git-current-branch) "master")
|
||||
(check-equal? (file->string (build-path "sub" "hello.txt")) "dirty\n")
|
||||
(call-with-output-file (build-path "sub" "hello.txt")
|
||||
#:exists 'truncate/replace
|
||||
(lambda (out) (displayln "changed" out)))
|
||||
|
||||
(git 'branch '-d "work")
|
||||
(check-false (member "work" (git 'branch)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user