Menu

#49 Diffuse fail with git modules because .git is a file and not a directory

open
nobody
None
5
2016-02-16
2016-02-15
Gur Stavi
No

When using git modules the directory structure is:

Project
.git folder
.gitmodules folder
Module
.git file that refers to .gitmodules folder within the project

When trying to use Diffuse on a file within the git module, Diffuse is looking for a '.git' folder in the function 'findByFolder'. It skips the .git file in the module because it is not a directory and finds the .git folder of the project.
Then git commands fail because git actually 'wants' to use the .git file.
Diffuse should relax the lookup for git and allow .git directory or file.

A quick fix would be to change
if os.path.isdir(name):
into
if os.path.isdir(name) or os.path.isfile(name):

But perhaps a fix that is limited to git or even checks the contents of .git file would be more complete.

Thanks,
Gur

Discussion

  • Derrick Moser

    Derrick Moser - 2016-02-15

    I am not very familiar with Git submodules but I have committed an update to improve handling of them. Please give the development version a spin.

     
  • Gur Stavi

    Gur Stavi - 2016-02-16

    Development version works fine with git submodules.
    Thanks,
    Gur

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.