Skip to content

Commit 2b0c9a6

Browse files
committed
fix: initialize Git repository before configuring user settings
1 parent b6ae242 commit 2b0c9a6

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ resolver = "2"
77
[package]
88
name = "backend"
99
description = "Backend API and services for StackClass"
10-
version = "0.32.1"
10+
version = "0.32.2"
1111
edition = "2024"
1212

1313
default-run = "stackclass-server"

openapi.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"license": {
77
"name": ""
88
},
9-
"version": "0.32.1"
9+
"version": "0.32.2"
1010
},
1111
"paths": {
1212
"/v1/courses": {

src/service/repository.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,19 @@ impl RepoService {
8080
fs_extra::dir::copy(&template_dir, workspace, &copy_options)
8181
.map_err(|e| StorageError::CopyFiles(e.to_string()))?;
8282

83+
// Initialize Git repository
84+
git::init(workspace).await?;
85+
8386
// Configure Git user information
8487
git::config(workspace, "user.name", git_committer_name).await?;
8588
git::config(workspace, "user.email", git_committer_email).await?;
8689

8790
// Perform Git operations to commit the source code
88-
git::init(workspace).await?;
8991
git::stage(workspace).await?;
9092
git::commit(workspace, "Initial commit from template").await?;
9193

9294
// ... and push to the remote repository
93-
let remote_url = format!("{git_server_endpoint}/{owner}/{repo}");
95+
let remote_url = format!("{git_server_endpoint}/{owner}/{repo}.git");
9496
git::add_remote(workspace, "origin", &remote_url).await?;
9597
git::push(workspace, "origin", "main").await?;
9698

0 commit comments

Comments
 (0)