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

git-crypt setup fails when user has untracked files in repository #5

Closed
Aeon opened this issue Mar 7, 2013 · 3 comments
Closed

git-crypt setup fails when user has untracked files in repository #5

Aeon opened this issue Mar 7, 2013 · 3 comments
Assignees

Comments

@Aeon
Copy link

Aeon commented Mar 7, 2013

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

$ git-crypt init ~/git-crypt.key
Working directory not clean.
Please commit your changes or 'git stash' them before setting up git-crypt.

this is apparently due to git-crypt just checking for output of git status --porcelain not being empty in https://github.com/AGWA/git-crypt/blob/master/commands.cpp#L205

I think it should only check for modified files, and ignore untracked files (untracked files are not touched by git reset anyway, so git-crypt setup should be safe even with untracked files being present).

@AGWA
Copy link
Owner

AGWA commented Mar 7, 2013

Hi, thanks for the report. You're absolutely right on all counts. 'git status --porcelain' outputs '??' for untracked files, so the fix is pretty simple: make sure no line of the output starts with anything other than '??'. I should be able to get to this today or tomorrow.

@ghost ghost assigned AGWA Mar 7, 2013
@AGWA
Copy link
Owner

AGWA commented Mar 7, 2013

Fixed in e184b39 with an even simpler solution: by passing '-uno' to 'git status' to ignore untracked files.

Thanks again for the report.

@AGWA AGWA closed this as completed Mar 7, 2013
@Aeon
Copy link
Author

Aeon commented Mar 8, 2013

wow, that was fast 🍰

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

2 participants