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
43a0bc01
Commit
43a0bc01
authored
May 19, 2011
by
Jakob Pfender
Committed by
Vicent Marti
May 23, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
backends/hiredis.c: Move to new error handling mechanism
parent
33b1d19e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
src/backends/hiredis.c
+6
-6
No files found.
src/backends/hiredis.c
View file @
43a0bc01
...
...
@@ -67,7 +67,7 @@ int hiredis_backend__read_header(size_t *len_p, git_otype *type_p, git_odb_backe
}
freeReplyObject
(
reply
);
return
error
;
return
error
==
GIT_SUCCESS
?
GIT_SUCCESS
:
git__rethrow
(
error
,
"Failed to read header"
)
;
}
int
hiredis_backend__read
(
void
**
data_p
,
size_t
*
len_p
,
git_otype
*
type_p
,
git_odb_backend
*
_backend
,
const
git_oid
*
oid
)
{
...
...
@@ -104,7 +104,7 @@ int hiredis_backend__read(void **data_p, size_t *len_p, git_otype *type_p, git_o
}
freeReplyObject
(
reply
);
return
error
;
return
error
==
GIT_SUCCESS
?
GIT_SUCCESS
:
git__rethrow
(
error
,
"Failed to read backend"
)
;
}
int
hiredis_backend__exists
(
git_odb_backend
*
_backend
,
const
git_oid
*
oid
)
{
...
...
@@ -137,7 +137,7 @@ int hiredis_backend__write(git_oid *id, git_odb_backend *_backend, const void *d
error
=
GIT_ERROR
;
if
((
error
=
git_odb_hash
(
id
,
data
,
len
,
type
))
<
0
)
return
error
;
return
git__rethrow
(
error
,
"Failed to write backend"
)
;
reply
=
redisCommand
(
backend
->
db
,
"HMSET %b "
"type %d "
...
...
@@ -148,7 +148,7 @@ int hiredis_backend__write(git_oid *id, git_odb_backend *_backend, const void *d
error
=
(
reply
==
NULL
||
reply
->
type
==
REDIS_REPLY_ERROR
)
?
GIT_ERROR
:
GIT_SUCCESS
;
freeReplyObject
(
reply
);
return
error
;
return
error
==
GIT_SUCCESS
?
GIT_SUCCESS
:
git__rethrow
(
error
,
"Failed to write backend"
)
;
}
void
hiredis_backend__free
(
git_odb_backend
*
_backend
)
{
...
...
@@ -184,7 +184,7 @@ int git_odb_backend_hiredis(git_odb_backend **backend_out, const char *host, int
return
GIT_SUCCESS
;
cleanup:
free
(
backend
);
return
GIT_ERROR
;
return
git__throw
(
GIT_ERROR
,
"Failed to get ODB backend"
)
;
}
#else
...
...
@@ -194,7 +194,7 @@ int git_odb_backend_hiredis(git_odb_backend ** GIT_UNUSED(backend_out),
GIT_UNUSED_ARG
(
backend_out
);
GIT_UNUSED_ARG
(
host
);
GIT_UNUSED_ARG
(
port
);
return
GIT_ENOTIMPLEMENTED
;
return
git__throw
(
GIT_ENOTIMPLEMENTED
,
"Failed to get ODB backend. Feature not yet implemented"
)
;
}
...
...
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