public void GivenNewRepository_WhenBare_ThenInitCreatesRefsDirectory() { Gitlet.Init(Bare()); var refsPath = Files.CurrentPath.Combine("refs"); Assert.That(Directory.Exists(refsPath), Is.True); }
public void GivenNewRepository_WhenNotBare_ThenInitCreatesRefsHeadsDirectory() { Gitlet.Init(); var refsHeadsPath = Files.CurrentPath.Combine(".gitlet", "refs", "heads"); Assert.That(Directory.Exists(refsHeadsPath), Is.True); }
public void GivenNewRepository_WhenNotBare_ThenInitCreatesObjectsDirectory() { Gitlet.Init(); var objectsPath = Files.CurrentPath.Combine(".gitlet", "objects"); Assert.That(Directory.Exists(objectsPath), Is.True); }
public void GivenNewRepository_WhenBare_ThenInitCreatesConfig() { Gitlet.Init(Bare()); var config = Files.CurrentPath.Combine("config").ReadAllText(); Assert.That(config, Is.EqualTo("[core]\n bare = true\n")); }
public void GivenNewRepository_WhenBare_ThenInitCreatesHead() { Gitlet.Init(Bare()); var head = Files.CurrentPath.Combine("HEAD").ReadAllText(); Assert.That(head, Is.EqualTo("ref: refs/heads/master\n")); }
public void GivenExistingRepository_ThenInitThrowException() { Gitlet.Init(); Assert.That(() => Gitlet.Init(), Throws.Exception.With.Message.EqualTo("unsupported")); }
public static void Init() { Gitlet.Init(); }