Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ghq(1) gets panic if current working directory is removed #99

Closed
gfx opened this issue Apr 11, 2018 · 0 comments · Fixed by #127
Closed

ghq(1) gets panic if current working directory is removed #99

gfx opened this issue Apr 11, 2018 · 0 comments · Fixed by #127

Comments

@gfx
Copy link
Contributor

gfx commented Apr 11, 2018

I have reported it here for information, but I expect that it is a kind of "wontfix" issue because it occurs in an abnormal environment.

Env

  • ghq 0.8.0 installed via homebrew

How to reproduce

  1. Open two terminals with the same cwd
  2. Runmkdir foo in one terminal
  3. Run rmdir foo in another terminal
  4. Run ghq root in the first terminal

output:

fatal: Unable to read current working directory: No such file or directory
panic: exit status 128

goroutine 1 [running]:
github.com/motemen/ghq/utils.PanicIf(0x124f700, 0xc42008ad80)
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/src/github.com/motemen/ghq/utils/log.go:53 +0x4a
main.localRepositoryRoots(0x3, 0xc42006c660, 0x119b600)
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/local_repository.go:195 +0x485
main.primaryLocalRepositoryRoot(0xc4200906e0, 0x119b2b8)
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/local_repository.go:219 +0x22
main.doRoot(0xc4200906e0, 0x0, 0xc4200906e0)
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/commands.go:453 +0x158
github.com/urfave/cli.HandleAction(0x116ab00, 0x11a5c98, 0xc4200906e0, 0xc42006c600, 0x0)
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/src/github.com/urfave/cli/app.go:490 +0xd4
github.com/urfave/cli.Command.Run(0x119b4e1, 0x4, 0x0, 0x0, 0x0, 0x0, 0x0, 0x119f53e, 0x17, 0x0, ...)
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/src/github.com/urfave/cli/command.go:210 +0xb6e
github.com/urfave/cli.(*App).Run(0xc420052ea0, 0xc42008a080, 0x2, 0x2, 0x0, 0x0)
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/src/github.com/urfave/cli/app.go:255 +0x76f
main.main()
	/private/tmp/ghq-20170822-8571-7p2dyy/ghq-0.8.0/main.go:12 +0x53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant