MCPcopy Create free account
hub / github.com/dtormoen/tsk-tsk / init_with_commit

Method init_with_commit

src/test_utils/git_test_utils.rs:120–127  ·  view source on GitHub ↗

Initializes a new git repository with an initial commit. Returns the commit SHA of the initial commit.

(&self)

Source from the content-addressed store, hash-verified

118 /// Initializes a new git repository with an initial commit.
119 /// Returns the commit SHA of the initial commit.
120 pub fn init_with_commit(&self) -> Result<String> {
121 self.init()?;
122
123 // Create an initial file
124 self.create_file("README.md", "# Test Repository\n")?;
125 self.stage_all()?;
126 self.commit("Initial commit")
127 }
128
129 /// Creates a file in the repository with the given content.
130 pub fn create_file(&self, path: &str, content: &str) -> Result<()> {

Calls 4

initMethod · 0.80
create_fileMethod · 0.80
stage_allMethod · 0.80
commitMethod · 0.80

Tested by

no test coverage detected