Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
c0d06537
Commit
c0d06537
authored
1 year ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
gittransport: cleanup
Change-Id: I5f2d557e9527a3ca01834fee072d257d51eae27f
parent
c1519ba4
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/gittransport.cpp
+7
-7
7 additions, 7 deletions
src/gittransport.cpp
with
7 additions
and
7 deletions
src/gittransport.cpp
+
7
−
7
View file @
c0d06537
...
@@ -144,37 +144,37 @@ P2PSubTransportAction(git_smart_subtransport_stream** out,
...
@@ -144,37 +144,37 @@ P2PSubTransportAction(git_smart_subtransport_stream** out,
{
{
auto
*
sub
=
reinterpret_cast
<
P2PSubTransport
*>
(
transport
);
auto
*
sub
=
reinterpret_cast
<
P2PSubTransport
*>
(
transport
);
if
(
!
sub
||
!
sub
->
remote
)
{
if
(
!
sub
||
!
sub
->
remote
)
{
JAMI_ERR
(
"Invalid subtransport"
);
JAMI_ERR
OR
(
"Invalid subtransport"
);
return
-
1
;
return
-
1
;
}
}
auto
repo
=
git_remote_owner
(
sub
->
remote
);
auto
repo
=
git_remote_owner
(
sub
->
remote
);
if
(
!
repo
)
{
if
(
!
repo
)
{
JAMI_ERR
(
"No repository linked to the transport"
);
JAMI_ERR
OR
(
"No repository linked to the transport"
);
return
-
1
;
return
-
1
;
}
}
const
auto
*
workdir
=
git_repository_workdir
(
repo
);
const
auto
*
workdir
=
git_repository_workdir
(
repo
);
if
(
!
workdir
)
{
if
(
!
workdir
)
{
JAMI_ERR
(
"No working linked to the repository"
);
JAMI_ERR
OR
(
"No working linked to the repository"
);
return
-
1
;
return
-
1
;
}
}
std
::
string_view
path
=
workdir
;
std
::
string_view
path
=
workdir
;
auto
delimConv
=
path
.
rfind
(
"/conversations"
);
auto
delimConv
=
path
.
rfind
(
"/conversations"
);
if
(
delimConv
==
std
::
string
::
npos
)
{
if
(
delimConv
==
std
::
string
::
npos
)
{
JAMI_ERR
(
"No conversation id found"
);
JAMI_ERR
OR
(
"No conversation id found"
);
return
-
1
;
return
-
1
;
}
}
auto
delimAccount
=
path
.
rfind
(
'/'
,
delimConv
-
1
);
auto
delimAccount
=
path
.
rfind
(
'/'
,
delimConv
-
1
);
if
(
delimAccount
==
std
::
string
::
npos
&&
delimConv
-
1
-
delimAccount
==
16
)
{
if
(
delimAccount
==
std
::
string
::
npos
&&
delimConv
-
1
-
delimAccount
==
16
)
{
JAMI_ERR
(
"No account id found"
);
JAMI_ERR
OR
(
"No account id found"
);
return
-
1
;
return
-
1
;
}
}
auto
accountId
=
path
.
substr
(
delimAccount
+
1
,
delimConv
-
1
-
delimAccount
);
auto
accountId
=
path
.
substr
(
delimAccount
+
1
,
delimConv
-
1
-
delimAccount
);
std
::
string_view
gitUrl
=
url
+
std
::
string
(
"git://"
).
size
();
std
::
string_view
gitUrl
=
url
+
(
"git://"
sv
).
size
();
auto
delim
=
gitUrl
.
find
(
'/'
);
auto
delim
=
gitUrl
.
find
(
'/'
);
if
(
delim
==
std
::
string
::
npos
)
{
if
(
delim
==
std
::
string
::
npos
)
{
JAMI_ERR
(
"Incorrect url
%s"
,
std
::
string
(
gitUrl
).
c_str
()
);
JAMI_ERR
OR
(
"Incorrect url
{:s}"
,
gitUrl
);
return
-
1
;
return
-
1
;
}
}
auto
deviceId
=
gitUrl
.
substr
(
0
,
delim
);
auto
deviceId
=
gitUrl
.
substr
(
0
,
delim
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment