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

Added clean_state_files #386

Merged
merged 3 commits into from
Jul 9, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pygit2/decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ int git_remote_create(
git_repository *repo,
const char *name,
const char *url);
int git_repository_state_cleanup(git_repository *repo);

const char * git_remote_name(const git_remote *remote);

Expand Down
8 changes: 8 additions & 0 deletions pygit2/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,3 +299,11 @@ def treeish_to_tree(obj):
raise NotImplementedError('git_diff_blob_to_blob()')

raise ValueError("Only blobs and treeish can be diffed")

def state_cleanup(self):
"""
Remove all the metadata associated with an ongoing command like
merge, revert, cherry-pick, etc. For example: MERGE_HEAD, MERGE_MSG,
etc.
"""
C.git_repository_state_cleanup(self._repo)