diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-11-20 13:19:23 -0500 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-11-20 13:19:23 -0500 |
commit | 2ea40fdaac2a3b6ceabb02f17734d14831fd3470 (patch) | |
tree | ca5e95d300372078993a46b958e61a5b7dfde14f /src/repository.c | |
parent | 69d1494873ee170ae33c37943c75bf7fa1c9d89d (diff) | |
download | libgit2-2ea40fdaac2a3b6ceabb02f17734d14831fd3470.tar.gz |
repository: distinguish sequencer cherry-pick and revertcmn/repository-state-sequencer
These are not quite like their plain counterparts and require special handling.
Diffstat (limited to 'src/repository.c')
-rw-r--r-- | src/repository.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/repository.c b/src/repository.c index c61d0e4f0..6234cd595 100644 --- a/src/repository.c +++ b/src/repository.c @@ -2222,11 +2222,17 @@ int git_repository_state(git_repository *repo) state = GIT_REPOSITORY_STATE_APPLY_MAILBOX_OR_REBASE; else if (git_path_contains_file(&repo_path, GIT_MERGE_HEAD_FILE)) state = GIT_REPOSITORY_STATE_MERGE; - else if(git_path_contains_file(&repo_path, GIT_REVERT_HEAD_FILE)) + else if (git_path_contains_file(&repo_path, GIT_REVERT_HEAD_FILE)) { state = GIT_REPOSITORY_STATE_REVERT; - else if(git_path_contains_file(&repo_path, GIT_CHERRYPICK_HEAD_FILE)) + if (git_path_contains_file(&repo_path, GIT_SEQUENCER_TODO_FILE)) { + state = GIT_REPOSITORY_STATE_REVERT_SEQUENCE; + } + } else if (git_path_contains_file(&repo_path, GIT_CHERRYPICK_HEAD_FILE)) { state = GIT_REPOSITORY_STATE_CHERRYPICK; - else if(git_path_contains_file(&repo_path, GIT_BISECT_LOG_FILE)) + if (git_path_contains_file(&repo_path, GIT_SEQUENCER_TODO_FILE)) { + state = GIT_REPOSITORY_STATE_CHERRYPICK_SEQUENCE; + } + } else if (git_path_contains_file(&repo_path, GIT_BISECT_LOG_FILE)) state = GIT_REPOSITORY_STATE_BISECT; git_buf_free(&repo_path); @@ -2271,6 +2277,7 @@ static const char *state_files[] = { GIT_BISECT_LOG_FILE, GIT_REBASE_MERGE_DIR, GIT_REBASE_APPLY_DIR, + GIT_SEQUENCER_DIR, }; int git_repository_state_cleanup(git_repository *repo) |