Staging
v0.5.1
https://github.com/git/git
Raw File
Tip revision: 2ce0edcd786b790fed580e7df56291619834d276 authored by Junio C Hamano on 21 December 2011, 20:02:13 UTC
Git 1.7.8.1
Tip revision: 2ce0edc
sequencer.c
#include "cache.h"
#include "sequencer.h"
#include "strbuf.h"
#include "dir.h"

void remove_sequencer_state(int aggressive)
{
	struct strbuf seq_dir = STRBUF_INIT;
	struct strbuf seq_old_dir = STRBUF_INIT;

	strbuf_addf(&seq_dir, "%s", git_path(SEQ_DIR));
	strbuf_addf(&seq_old_dir, "%s", git_path(SEQ_OLD_DIR));
	remove_dir_recursively(&seq_old_dir, 0);
	rename(git_path(SEQ_DIR), git_path(SEQ_OLD_DIR));
	if (aggressive)
		remove_dir_recursively(&seq_old_dir, 0);
	strbuf_release(&seq_dir);
	strbuf_release(&seq_old_dir);
}
back to top