mirror of
https://github.com/x-motemen/ghq.git
synced 2026-09-10 07:26:27 -04:00
Fix Windows worktree test by normalizing path separators
Git on Windows uses forward slashes in .git files, even though Windows uses backslashes. Use filepath.ToSlash() to normalize paths for comparison in the worktree migration tests. Co-authored-by: Songmu <177122+Songmu@users.noreply.github.com>
This commit is contained in:
parent
d82dd80f86
commit
a12656da90
|
|
@ -132,7 +132,7 @@ func TestDoMigrate(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
wantGitdir := "gitdir: " + filepath.Join(dest, ".git", "worktrees", "wt")
|
||||
wantGitdir := "gitdir: " + filepath.ToSlash(filepath.Join(dest, ".git", "worktrees", "wt"))
|
||||
if got := strings.TrimSpace(string(content)); got != wantGitdir {
|
||||
t.Errorf("worktree .git:\n got: %s\n want: %s", got, wantGitdir)
|
||||
}
|
||||
|
|
@ -197,7 +197,7 @@ func TestDoMigrate(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
wantGitdir := "gitdir: " + filepath.Join(dest, ".git", "worktrees", "feat")
|
||||
wantGitdir := "gitdir: " + filepath.ToSlash(filepath.Join(dest, ".git", "worktrees", "feat"))
|
||||
if got := strings.TrimSpace(string(content)); got != wantGitdir {
|
||||
t.Errorf("internal worktree .git:\n got: %s\n want: %s", got, wantGitdir)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue