Win32: patch Windows environment on startup
[git/mingw/4msysgit/kblees.git] / sequencer.c
blobbc2c046aab23c5b3de8caa02c23703856ee86fb4
1 #include "cache.h"
2 #include "sequencer.h"
3 #include "strbuf.h"
4 #include "dir.h"
6 void remove_sequencer_state(int aggressive)
8 struct strbuf seq_dir = STRBUF_INIT;
9 struct strbuf seq_old_dir = STRBUF_INIT;
11 strbuf_addf(&seq_dir, "%s", git_path(SEQ_DIR));
12 strbuf_addf(&seq_old_dir, "%s", git_path(SEQ_OLD_DIR));
13 remove_dir_recursively(&seq_old_dir, 0);
14 rename(git_path(SEQ_DIR), git_path(SEQ_OLD_DIR));
15 if (aggressive)
16 remove_dir_recursively(&seq_old_dir, 0);
17 strbuf_release(&seq_dir);
18 strbuf_release(&seq_old_dir);