-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(cmd): checkout supports specifying a directory
- Loading branch information
Showing
4 changed files
with
58 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package cmd | ||
|
||
import ( | ||
"testing" | ||
) | ||
|
||
func TestDoubleCheckout(t *testing.T) { | ||
runner := NewFSITestRunner(t, "double_checkout") | ||
defer runner.Delete() | ||
|
||
_ = runner.CreateAndChdirToWorkDir("checkout_dir") | ||
|
||
// Init as a linked directory | ||
if err := runner.ExecCommand("qri init --name double_checkout --format csv"); err != nil { | ||
t.Fatal(err.Error()) | ||
} | ||
|
||
// Save a version of the dataset | ||
if err := runner.ExecCommand("qri save"); err != nil { | ||
t.Fatal(err.Error()) | ||
} | ||
|
||
// Move to different work directory | ||
runner.ChdirToRoot() | ||
|
||
// Checkout should fail as the dataset already linked | ||
if err := runner.ExecCommand("qri checkout me/double_checkout ./checkout_test"); err == nil { | ||
t.Fatal("`qri checkout` should fail if already linked, but did not fail") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters