summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/refs.h5
-rw-r--r--src/repository.c13
2 files changed, 15 insertions, 3 deletions
diff --git a/src/refs.h b/src/refs.h
index f78ea06b0..fda9532de 100644
--- a/src/refs.h
+++ b/src/refs.h
@@ -44,6 +44,11 @@
#define GIT_REBASE_APPLY_APPLYING_FILE GIT_REBASE_APPLY_DIR "applying"
#define GIT_REFS_HEADS_MASTER_FILE GIT_REFS_HEADS_DIR "master"
+#define GIT_SEQUENCER_DIR "sequencer/"
+#define GIT_SEQUENCER_HEAD_FILE GIT_SEQUENCER_DIR "head"
+#define GIT_SEQUENCER_OPTIONS_FILE GIT_SEQUENCER_DIR "options"
+#define GIT_SEQUENCER_TODO_FILE GIT_SEQUENCER_DIR "todo"
+
#define GIT_STASH_FILE "stash"
#define GIT_REFS_STASH_FILE GIT_REFS_DIR GIT_STASH_FILE
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)