atom / git-diff

Diff markers in Atom's gutter
MIT License
102 stars 41 forks source link

git projects with --separate-git-dir don't get processed by git-diff #134

Closed karldw closed 5 years ago

karldw commented 7 years ago

Prerequisites

Description

When a git directory is initialized with --separate-git-dir (as an option to git init or git clone), git creates a .git file pointing to the repository location. It would be a nice feature if git-diff followed that pointer to perform diffs with the actual git repo.

Steps to Reproduce

  1. Initialize a git repository with a separate repo directory: git clone --separate-git-dir=$HOME/separated_git-diff git@github.com:atom/git-diff.git git-diff1
  2. Repeat without separate-git-dir: git clone git@github.com:atom/git-diff.git git-diff2
  3. Open the projects in Atom: atom git-diff1 git-diff2

Expected behavior: The two projects look and act the same.

Actual behavior: The one with a separated git dir, git-diff1, is treated as a folder with no git repo.

In the screenshot below, I've added a line to the coffeelint file in both repos, but only git-diff2 has color.

screenshot comparison

Reproduces how often: 100% of the time.

Versions

Atom: 1.17.2 Electron: 1.3.15 Chrome: 52.0.2743.82 Node: 6.5.0

apm: 1.17.0 npm: 3.10.5 python 3.6.1 git: 2.13.0.windows.1 visual studio

Windows: 10

Additional Information

Related to https://github.com/atom/atom/issues/2203 I used git bash for the command line steps, but the result is the same in git cmd.

maxbrunsfeld commented 5 years ago

Closing this as a duplicate of https://github.com/atom/git-diff/issues/134.