mirror of
https://github.com/dolthub/dolt.git
synced 2026-05-01 11:49:54 -05:00
bats/remotes-file-system.bats: Update for new clone behavior.
This commit is contained in:
@@ -157,80 +157,11 @@ SQL
|
||||
dolt clone file://../remote1 test-repo
|
||||
cd test-repo
|
||||
|
||||
run dolt branch
|
||||
run dolt branch -a
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" =~ "master" ]] || false
|
||||
[[ "$output" =~ "tester" ]] || false
|
||||
|
||||
# delete tester branch
|
||||
dolt branch -d -f tester
|
||||
|
||||
run dolt branch
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "$output" =~ "master" ]] || false
|
||||
[[ ! "$output" =~ "tester" ]] || false
|
||||
}
|
||||
|
||||
@test "branches can be deleted after fetch" {
|
||||
# create a new branch
|
||||
run dolt checkout -b tester
|
||||
[ "$status" -eq 0 ]
|
||||
|
||||
# demonstrate there is no table named test on tester
|
||||
run dolt ls
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${lines[0]}" =~ "No tables in working set" ]] || false
|
||||
|
||||
# seed tester with some data
|
||||
dolt sql <<SQL
|
||||
CREATE TABLE test (
|
||||
pk BIGINT NOT NULL COMMENT 'tag:0',
|
||||
c1 BIGINT COMMENT 'tag:1',
|
||||
c2 BIGINT COMMENT 'tag:2',
|
||||
c3 BIGINT COMMENT 'tag:3',
|
||||
c4 BIGINT COMMENT 'tag:4',
|
||||
c5 BIGINT COMMENT 'tag:5',
|
||||
PRIMARY KEY (pk)
|
||||
);
|
||||
SQL
|
||||
dolt add test
|
||||
dolt commit -m "test commit"
|
||||
|
||||
# create the remote data storage directories
|
||||
mkdir remote1
|
||||
|
||||
# push both branches to remote
|
||||
dolt remote add origin file://remote1
|
||||
dolt push origin tester
|
||||
|
||||
dolt checkout master
|
||||
dolt push origin master
|
||||
|
||||
# clone from a directory
|
||||
cd dolt-repo-clones
|
||||
dolt clone file://../remote1 test-repo
|
||||
cd test-repo
|
||||
|
||||
run dolt branch
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${lines[0]}" =~ "master" ]] || false
|
||||
[[ "${lines[1]}" =~ "tester" ]] || false
|
||||
|
||||
# delete tester branch
|
||||
dolt branch -d -f tester
|
||||
|
||||
run dolt branch
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${lines[0]}" =~ "master" ]] || false
|
||||
[[ "${lines[1]}" != "tester" ]] || false
|
||||
|
||||
# fetch branches from remote
|
||||
dolt fetch
|
||||
|
||||
# should display both branches fetched from remote
|
||||
run dolt branch
|
||||
[ "$status" -eq 0 ]
|
||||
[[ "${lines[0]}" =~ "master" ]] || false
|
||||
[[ "$output" =~ "* master" ]] || false
|
||||
[[ "$output" =~ "remotes/origin/tester" ]] || false
|
||||
[[ "$output" =~ "remotes/origin/master" ]] || false
|
||||
}
|
||||
|
||||
@test "clone from a directory that is not a dolt repo" {
|
||||
@@ -241,4 +172,4 @@ SQL
|
||||
run dolt clone file://../remotedir test-repo
|
||||
[ "$status" -eq 1 ]
|
||||
[ ! -d test-repo ]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user