More working commands
This commit is contained in:
+8
-3
@@ -14,6 +14,7 @@
|
||||
(git 'init)
|
||||
(check-true (git-repository?))
|
||||
(check-equal? (git-current-branch) "master")
|
||||
(check-equal? (git 'branch-current) "master")
|
||||
(check-true (git-clean?))
|
||||
|
||||
(git 'config "user.name" "Racket Git Test")
|
||||
@@ -83,7 +84,8 @@
|
||||
(git 'commit "work change")
|
||||
(check-equal? (file->string (build-path "sub" "hello.txt")) "work\n")
|
||||
|
||||
(git 'checkout "master")
|
||||
(check-equal? (git 'branch-current) "work")
|
||||
(git 'switch "master")
|
||||
(check-equal? (file->string (build-path "sub" "hello.txt")) "changed\n")
|
||||
(check-equal? (git-current-branch) "master")
|
||||
(check-not-false (member "work" (git 'branch)))
|
||||
@@ -92,7 +94,7 @@
|
||||
(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-exn exn:fail? (lambda () (git 'switch "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")
|
||||
@@ -107,7 +109,10 @@
|
||||
(check-equal? (git 'tag) '("v0.1"))
|
||||
(git 'checkout "v0.1")
|
||||
(check-false (git-current-branch))
|
||||
(git 'checkout "master")
|
||||
(check-false (git 'branch-current))
|
||||
(check-exn exn:fail? (lambda () (git 'switch "missing")))
|
||||
(git 'switch "master")
|
||||
(check-equal? (git 'branch-current) "master")
|
||||
(git 'tag '-d "v0.1")
|
||||
(check-equal? (git 'tag) '())
|
||||
|
||||
|
||||
Reference in New Issue
Block a user