GitRepo.removeMergeMsg

Remove the merge message file for this repository. If the message file does not exist GitException is thrown. Use mergeMsgExists to check whether the merge message file exists.

struct GitRepo
void
removeMergeMsg
(
)

Examples

1 // write a merge message file and verify it can be read
2 auto repo = initRepo(_userRepo, OpenBare.yes);
3 scope(exit) rmdirRecurse(_userRepo);
4 
5 string msgPath = buildPath(repo.path, "MERGE_MSG");
6 string msg = "merge this";
7 std.file.write(msgPath, msg);
8 
9 assert(repo.mergeMsg == msg);
10 
11 // verify removal of merge message
12 repo.removeMergeMsg();
13 assert(repo.mergeMsg is null);
14 
15 // verify throwing when removing file which doesn't exist
16 assertThrown!GitException(repo.removeMergeMsg());

Meta