Skip to content

Commit 59f4691

Browse files
committed
reset: use GIT_ASSERT
1 parent 36adde5 commit 59f4691

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/reset.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ int git_reset_default(
3333
int error;
3434
git_index *index = NULL;
3535

36-
assert(pathspecs != NULL && pathspecs->count > 0);
36+
GIT_ASSERT_ARG(pathspecs && pathspecs->count > 0);
3737

3838
memset(&entry, 0, sizeof(git_index_entry));
3939

@@ -62,10 +62,10 @@ int git_reset_default(
6262
for (i = 0, max_i = git_diff_num_deltas(diff); i < max_i; ++i) {
6363
const git_diff_delta *delta = git_diff_get_delta(diff, i);
6464

65-
assert(delta->status == GIT_DELTA_ADDED ||
66-
delta->status == GIT_DELTA_MODIFIED ||
67-
delta->status == GIT_DELTA_CONFLICTED ||
68-
delta->status == GIT_DELTA_DELETED);
65+
GIT_ASSERT(delta->status == GIT_DELTA_ADDED ||
66+
delta->status == GIT_DELTA_MODIFIED ||
67+
delta->status == GIT_DELTA_CONFLICTED ||
68+
delta->status == GIT_DELTA_DELETED);
6969

7070
error = git_index_conflict_remove(index, delta->old_file.path);
7171
if (error < 0) {
@@ -113,7 +113,8 @@ static int reset(
113113
git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
114114
git_buf log_message = GIT_BUF_INIT;
115115

116-
assert(repo && target);
116+
GIT_ASSERT_ARG(repo);
117+
GIT_ASSERT_ARG(target);
117118

118119
if (checkout_opts)
119120
opts = *checkout_opts;

0 commit comments

Comments
 (0)