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

No error when failing to add an extant file using Windows-style paths #24

Open
me-and opened this issue Apr 20, 2016 · 2 comments
Open

Comments

@me-and
Copy link
Member

me-and commented Apr 20, 2016

Reported here. I've attempted to report it upstream, but my email doesn't seem to have got through; need to see if it's just a delay in it getting synced to Gmane or if there's something more fundamental going wrong.

Quoting from the report I attempted to send upstream...

If I attempt to git add an extant file specified using a Windows-style path on Cygwin Git, this doesn't add the file, and produces no error message:

$ pwd  # As seen by Cygwin
/cygdrive/c/tmp

$ cygpath -aw .  # As seen by Windows
C:\tmp

$ git init
Initialized empty Git repository in /cygdrive/c/tmp/.git/

$ git add 'c:\tmp\file' || echo non-zero exit code  # Errors out as expected
fatal: pathspec 'c:\tmp\file' did not match any files
non-zero exit code

$ touch file

$ git add 'c:\tmp\file' || echo non-zero exit code  # No error this time...

$ git status  # ...even though the file didn't get added
On branch master

Initial commit

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        file

nothing added to commit but untracked files present (use "git add" to track)

I wouldn't expect adding the file to actually succeed, but I would expect it to either succeed or produce an error, rather than silently failing.

Experimentation shows I get the same behaviour for 'c:\tmp\file', 'c:/tmp/file' and 'subdir\file'. I'm seeing this on v2.8.0; the downstream report says the same behaviour occurs on v2.7.4, and I've also seen what appears to be the same behaviour on a v2.0.5 build I produced to check.

@me-and
Copy link
Member Author

me-and commented Apr 25, 2016

Reported upstream. Twice, because I'm a numpty.

@me-and me-and added the blocked label Apr 25, 2016
@me-and me-and removed the blocked label Aug 25, 2017
@me-and
Copy link
Member Author

me-and commented Aug 25, 2017

Unblocking as I should chase this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant