open-on-github icon indicating copy to clipboard operation
open-on-github copied to clipboard

Picking wrong repository when opening on github

Open neerolyte opened this issue 7 years ago • 3 comments

Prerequisites

The prerequisites don't make sense for a package issue.

Description

If you have opened a directory in atom, but are editing a file from a directory below that level that belongs to a different repository (via a regular clone, submodules seem to work correctly) the opened URL belongs to the wrong repository.

Steps to Reproduce

  1. git clone [email protected]:atom/atom.git
  2. cd atom
  3. git clone [email protected]:atom/open-on-github.git
  4. atom . # note that we're opening the atom directory, not open-on-github
  5. Open a file from the open-on-github clone
  6. Activate "Open On Github: File"

Expected behavior: [What you expect to happen]

Links to requested file.

Actual behavior: [What actually happens]

Links to corrupt URL (generally a 404).

Reproduces how often: [What percentage of the time does it reproduce?]

100%

Versions

$ atom --version
Atom    : 1.17.2
Electron: 1.3.15
Chrome  : 52.0.2743.82
Node    : 6.5.0
$ apm --version
apm  1.17.0
npm  3.10.5
node 6.9.5 x64
python 2.7.12
git 2.12.2

OS X 10.12.5

neerolyte avatar Jun 15 '17 08:06 neerolyte

  1. Open a file from the open-on-github clone

Just to ensure that we're exactly reproducing the behavior you're seeing, can you state a specific file that you're opening?

Links to corrupt URL (generally a 404).

Can you share the URL as well for additional help in diagnosing the issue?

jasonrudolph avatar Jun 15 '17 12:06 jasonrudolph

Sure.

  1. Open open-on-github/menus/open-on-github.cson in the editor (using command-P)
  2. Choose "Open On GitHub: File" from the command pallete
  3. Focus changes to a new tab in Chrome, opening https://github.com/atom/atom/blob/master/open-on-github/menus/open-on-github.cson#L1

neerolyte avatar Jun 15 '17 13:06 neerolyte

I'm pretty sure it's just the command that opens the directories initially that matters, e.g if I change step 4 to atom . open-on-github (i.e explicitly opening both repo roots) following steps 5+6 gets me to https://github.com/atom/open-on-github/blob/master/menus/open-on-github.cson#L1 (the correct url).

neerolyte avatar Jun 15 '17 13:06 neerolyte