Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
4584660e
Commit
4584660e
authored
Aug 08, 2021
by
Peter Pettersson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bugfix: don't generate paths with empty segments
parent
d095502e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
src/refdb_fs.c
+3
-2
src/worktree.c
+3
-3
No files found.
src/refdb_fs.c
View file @
4584660e
...
...
@@ -578,7 +578,7 @@ static int iter_load_loose_paths(refdb_fs_backend *backend, refdb_fs_iter *iter)
}
}
if
((
error
=
git_buf_p
rintf
(
&
path
,
"%s/"
,
backend
->
commonpath
))
<
0
||
if
((
error
=
git_buf_p
uts
(
&
path
,
backend
->
commonpath
))
<
0
||
(
error
=
git_buf_put
(
&
path
,
ref_prefix
,
ref_prefix_len
))
<
0
)
{
git_buf_dispose
(
&
path
);
return
error
;
...
...
@@ -1609,8 +1609,9 @@ static char *setup_namespace(git_repository *repo, const char *in)
GIT_MKDIR_PATH
,
NULL
)
<
0
)
goto
done
;
/* Return root of the namespaced gitpath, i.e. without the trailing '
/
refs' */
/* Return root of the namespaced gitpath, i.e. without the trailing 'refs' */
git_buf_rtruncate_at_char
(
&
path
,
'/'
);
git_buf_putc
(
&
path
,
'/'
);
out
=
git_buf_detach
(
&
path
);
done:
...
...
src/worktree.c
View file @
4584660e
...
...
@@ -43,7 +43,7 @@ int git_worktree_list(git_strarray *wts, git_repository *repo)
wts
->
count
=
0
;
wts
->
strings
=
NULL
;
if
((
error
=
git_buf_
printf
(
&
path
,
"%s/worktrees/"
,
repo
->
commondir
))
<
0
)
if
((
error
=
git_buf_
joinpath
(
&
path
,
repo
->
commondir
,
"worktrees/"
))
<
0
)
goto
exit
;
if
(
!
git_path_exists
(
path
.
ptr
)
||
git_path_is_empty_dir
(
path
.
ptr
))
goto
exit
;
...
...
@@ -182,7 +182,7 @@ int git_worktree_lookup(git_worktree **out, git_repository *repo, const char *na
*
out
=
NULL
;
if
((
error
=
git_buf_
printf
(
&
path
,
"%s/worktrees/%s"
,
repo
->
commondir
,
name
))
<
0
)
if
((
error
=
git_buf_
join3
(
&
path
,
'/'
,
repo
->
commondir
,
"worktrees"
,
name
))
<
0
)
goto
out
;
if
((
error
=
(
open_worktree_dir
(
out
,
git_repository_workdir
(
repo
),
path
.
ptr
,
name
)))
<
0
)
...
...
@@ -592,7 +592,7 @@ int git_worktree_prune(git_worktree *wt,
}
/* Delete gitdir in parent repository */
if
((
err
=
git_buf_
printf
(
&
path
,
"%s/worktrees/%s"
,
wt
->
commondir_path
,
wt
->
name
))
<
0
)
if
((
err
=
git_buf_
join3
(
&
path
,
'/'
,
wt
->
commondir_path
,
"worktrees"
,
wt
->
name
))
<
0
)
goto
out
;
if
(
!
git_path_exists
(
path
.
ptr
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment