Skip to content

Commit 165ec28

Browse files
committed
make compile
1 parent f06f009 commit 165ec28

File tree

4 files changed

+4
-15
lines changed

4 files changed

+4
-15
lines changed

git/libgit.v

-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,6 @@ pub fn (repo &Repo) primary_branch() string {
216216
return get_branch_name_from_reference(branch)
217217
}
218218

219-
// Assuming this helper function exists elsewhere in your code
220219
fn get_branch_name_from_reference(ref string) string {
221220
return ref.after('refs/heads/')
222221
}

git/util.v

-11
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ module git
33
import strings
44
import net.http
55
import os
6-
import regex
76

87
pub fn parse_branch_name_from_receive_upload(upload string) ?string {
98
upload_lines := upload.split_into_lines()
@@ -71,16 +70,6 @@ pub fn get_git_executable_path() ?string {
7170
return which_output.trim(' \n')
7271
}
7372

74-
pub fn get_repository_primary_branch(path string) string {
75-
git_result := os.execute('git -C ${path} symbolic-ref HEAD')
76-
git_exit_code := git_result.exit_code
77-
git_output := git_result.output.trim(' \n')
78-
if git_exit_code != 0 {
79-
return ''
80-
}
81-
return get_branch_name_from_reference(git_output)
82-
}
83-
8473
pub fn remove_git_extension_if_exists(git_repository_name string) string {
8574
return git_repository_name.trim_string_right('.git')
8675
}

highlight/markdown.v

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ fn sanitize_html_tags_with_re(re string, code string) string {
112112
matched := tags_re.match_str(result, last_found_index, 0) or { break }
113113
tag := matched.get(0) or { continue }
114114

115-
matched_start_index := result.index_after(tag, last_found_index)
115+
matched_start_index := result.index_after_(tag, last_found_index)
116116
last_found_index = matched_start_index + tag.len
117117

118118
tag_parts := matched.get_all()
@@ -165,7 +165,7 @@ fn sanitize_html_attributes(attributes string) string {
165165
matched := attributes_re.match_str(result, last_found_index, 0) or { break }
166166
attribute := matched.get(0) or { break }
167167

168-
matched_start_index := result.index_after(attribute, last_found_index)
168+
matched_start_index := result.index_after_(attribute, last_found_index)
169169
last_found_index += matched_start_index + attribute.len
170170

171171
attribute_parts := matched.get_all()

src/repo_routes.v

+2-1
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,8 @@ pub fn (mut app App) handle_new_repo(mut ctx Context, name string, clone_url str
256256
return ctx.redirect('/new')
257257
}
258258
repo_id := new_repo2.id
259-
primary_branch := git.get_repository_primary_branch(repo_path)
259+
// primary_branch := git.get_repository_primary_branch(repo_path)
260+
primary_branch := new_repo2.git_repo.primary_branch()
260261
app.update_repo_primary_branch(repo_id, primary_branch) or {
261262
ctx.error('There was an error while adding the repo')
262263
return app.new(mut ctx)

0 commit comments

Comments
 (0)