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

Weird git status after commit. #254

Closed
tomaszwojcik opened this issue Aug 16, 2013 · 2 comments
Closed

Weird git status after commit. #254

tomaszwojcik opened this issue Aug 16, 2013 · 2 comments

Comments

@tomaszwojcik
Copy link

I'm trying to add untracked files and commit them.
The problem is that after commit I can see files in the log but files state is rolled back to untracked and.

Before commit:
zrzut ekranu 2013-08-16 o 15 19 19

After commit:
zrzut ekranu 2013-08-16 o 15 19 31

Here's the gist with my working code https://gist.github.com/tomaszwojcik/6249891
I have debugged methods that provide files and data for the commit (author, parents, tree) - however I am unsure about Git::Manager#prepare_commit_tree.

And the code I'm running:

git = Git::Manager.new
untracked_files = git.index_untracked_files
git.commit 'Rugged commit', untracked_files

I have tried tree builder, with the same result.
Am I missing some save/update method?

@nvloff
Copy link
Contributor

nvloff commented Aug 16, 2013

Could you try @index.write if the commit was successful.

@tomaszwojcik
Copy link
Author

Works!

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