GitRepo.cleanupMerge

Remove all the metadata associated with an ongoing git merge, including MERGE_HEAD, MERGE_MSG, etc.

struct GitRepo
void
cleanupMerge
()

Examples

// write a merge message file
auto repo = initRepo(_userRepo, OpenBare.yes);
scope(exit) rmdirRecurse(_userRepo);

string msgPath = buildPath(repo.path, "MERGE_MSG");
string msg = "merge this";
std.file.write(msgPath, msg);

assert(repo.mergeMsg == msg);

// verify removal of merge message
repo.cleanupMerge();
assert(repo.mergeMsg is null);

// verify throwing when removing file which doesn't exist
assertThrown!GitException(repo.removeMergeMsg());

Meta