atom / github

:octocat: Git and GitHub integration for Atom
https://github.atom.io
MIT License
1.11k stars 393 forks source link

Uncaught Error: ~/repos/myproject/src/components/App.scss does not belong to repo /home/user/repos/myproject/ #950

Closed varemenos closed 7 years ago

varemenos commented 7 years ago
  1. I load a git directory as my current atom project (doesn't have a remote, but has several commits)
  2. opened a file that contains unstaged changes
  3. tried to view unstaged changes (same thing happens with the staged changes command)
  4. got the error

Note: I've tried this in safe mode as well, same result

Atom: 1.18.0 x64 Electron: 1.3.15 OS: "Arch Linux" Thrown From: github package 0.3.3

Stack Trace

Uncaught Error: /home/adonisk/repos/sideprojects/adonisk.com/src/components/App.scss does not belong to repo /media/adonisk/linux/repos/sideprojects/adonisk.com

At /usr/share/atom/resources/app/node_modules/github/lib/controllers/root-controller.js:807

Error: /home/adonisk/repos/sideprojects/adonisk.com/src/components/App.scss does not belong to repo /media/adonisk/linux/repos/sideprojects/adonisk.com
    at RootController.viewChangesForCurrentFile (/usr/share/atom/resources/app/node_modules/github/lib/controllers/root-controller.js:807:19)
    at RootController.viewUnstagedChangesForCurrentFile (/usr/share/atom/resources/app/node_modules/github/lib/controllers/root-controller.js:812:16)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:265:35)
    at CommandRegistry.handleCommandEvent (/usr/share/atom/resources/app/src/command-registry.js:3:65)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/usr/share/atom/resources/app/src/command-registry.js:166:25)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchContextMenuCommand (/usr/share/atom/resources/app/src/atom-environment.js:1320:34)
    at EventEmitter.outerCallback (/usr/share/atom/resources/app/src/application-delegate.js:347:31)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)

Commands

  2x -3:48.6.0 core:backspace (input.hidden-input)
     -3:47.8.0 core:move-down (input.hidden-input)
  2x -3:47.6.0 core:move-up (input.hidden-input)
     -3:47.1.0 docblockr:parse-enter (input.hidden-input)
     -3:47.1.0 editor:newline (input.hidden-input)
     -3:46.9.0 intentions:highlight (input.hidden-input)
     -3:46.8.0 editor:delete-to-beginning-of-word (input.hidden-input)
     -3:46.4.0 intentions:highlight (input.hidden-input)
     -3:46 core:save (input.hidden-input)
     -3:44.1.0 intentions:highlight (input.hidden-input)
  2x -3:44 duplicate-line-or-selection:duplicate (input.hidden-input)
     -3:43.5.0 core:save (input.hidden-input)
     -3:37.5.0 github:open-file (span.github-FilePatchListView-path)
     -3:30.2.0 window:toggle-dev-tools (input.hidden-input)
     -0:10.8.0 github:view-staged-changes-for-current-file (div.line)
     -0:08.4.0 github:view-unstaged-changes-for-current-file (div.line)

Non-Core Packages

atom-beautify 0.30.0 
auto-detect-indentation 1.3.0 
autoclose-html 0.23.0 
autocomplete-modules 1.6.10 
ava 0.10.0 
busy-signal 1.4.3 
compare-files 0.8.0 
docblockr 0.10.3 
duotone-dark-syntax 2.1.0 
duplicate-line-or-selection 0.9.0 
editorconfig 2.2.2 
emmet 2.4.3 
file-icons 2.1.7 
file-types 0.5.5 
git-diff-details 1.4.0 
git-time-machine 1.5.9 
gtk-dark-theme 0.1.4 
hidpi 0.12.0 
highlight-selected 0.13.1 
hyperclick 0.0.40 
intentions 1.1.2 
js-hyperclick 1.11.0 
jscs-fixer 1.3.0 
language-apache 1.7.0 
language-babel 2.66.0 
language-dircolors 1.2.0 
language-docker 1.1.8 
language-documentation 2.0.1 
language-graphql 0.9.0 
language-ini 1.19.0 
language-liquid 0.5.1 
language-log 1.8.0 
language-patch 1.2.0 
language-pug 0.0.21 
language-regexp 1.0.1 
language-vcard 0.2.0 
line-diff-details 1.8.0 
linter 2.2.0 
linter-eslint 8.2.1 
linter-flow 5.6.0 
linter-jscs 4.1.2 
linter-jshint 3.1.2 
linter-jsonlint 1.3.0 
linter-ui-default 1.6.1 
live-archive 0.1.15 
local-history 4.3.0 
loved-syntax 1.0.1 
merge-conflicts 1.4.5 
minimap 4.28.2 
minimap-cursorline 0.2.0 
minimap-find-and-replace 4.5.2 
minimap-git-diff 4.3.1 
minimap-highlight-selected 4.6.1 
minimap-linter 2.0.0 
nuclide-format-js 0.0.36 
related 0.3.5 
release-notes 0.53.0 
set-syntax 0.3.2 
sync-settings 0.8.2 
tabulation-control 1.0.8 
tasks 2.6.6 
tool-bar 1.1.0 
tool-bar-almighty 0.8.2 
tree-view-git-status 1.4.0 
vscode-snippets 0.2.0 
smashwilson commented 7 years ago

Interesting. Looking at the paths in the error message, I suspect this has to do with repos being a symlink?

/home/adonisk/repos/sideprojects/adonisk.com/src/components/App.scss does not belong to repo /media/adonisk/linux/repos/sideprojects/adonisk.com

We likely need to resolve a project root path with fs.realPath as well. 🤔

varemenos commented 7 years ago

Indeed home/adonisk/repos/ is a symlink that points to /media/adonisk/linux/repos/