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

status untracked returns all files when ruby working directory is not same as git repo root #422

Open
asymptotik opened this issue Oct 1, 2019 · 2 comments

Comments

@asymptotik
Copy link

Subject of the issue

I was attempting to use ruby_git in fastlane which runs with the working directory under /fastlane. When attempting the following code, I get all the files:

require 'git'

git = Git.open('../')

p 'Untracked: '
git.status.untracked.each { |s| 
  p "#{s.to_s}" if s[1].untracked
}

If I run that some code in my repo root except with git = Git.open('../') I get the expected results which is just the files that are untracked.

Your environment

git version 2.18.0
ruby 2.6.0p0 (2018-12-25 revision 66547) [x86_64-darwin18]

Steps to reproduce

Tell us how to reproduce this issue.

Expected behaviour

I expected my program to exhibit the same results no matter where it is run provided that Git.open is passed the proper path to the repository root.

Actual behaviour

See above.

@stale stale bot added the wontfix label Nov 30, 2019
@jcouball jcouball removed the wontfix label Dec 1, 2019
@stale stale bot added the stale label Jan 30, 2020
@jelaniwoods
Copy link

@asymptotik This might be relevant #23 (comment)

@stale stale bot removed the stale label Jun 18, 2020
@stale stale bot added the stale label Aug 19, 2020
@ruby-git ruby-git deleted a comment from stale bot Feb 28, 2023
@stale stale bot removed the stale label Feb 28, 2023
@ruby-git ruby-git deleted a comment from stale bot Feb 28, 2023
@ruby-git ruby-git deleted a comment from stale bot Feb 28, 2023
@jcouball
Copy link
Member

jcouball commented Mar 1, 2023

I will have to reimplement how Git::Base#status fetches untracked files to actually use git status. I am afraid this will stay one the back burner for a bit longer.

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

No branches or pull requests

3 participants