Skip to content

Commit b69b3ec

Browse files
committed
fix: add arg.h
1 parent 1f2f454 commit b69b3ec

File tree

2 files changed

+22
-21
lines changed

2 files changed

+22
-21
lines changed

src/git2r_arg.c

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -181,27 +181,6 @@ git2r_arg_check_credentials(
181181
return 0;
182182
}
183183

184-
/**
185-
* Check proxy argument
186-
*
187-
* proxy may be NULL, TRUE or a string
188-
*
189-
* @param arg the arg to check
190-
* @return 0 if OK, else -1
191-
*/
192-
int attribute_hidden
193-
git2r_arg_check_proxy(
194-
SEXP arg)
195-
{
196-
if (Rf_isNull(arg))
197-
return 0;
198-
if (Rf_isLogical(arg) && 1 == Rf_length(arg) && NA_LOGICAL != LOGICAL(arg)[0])
199-
return 0;
200-
if (Rf_isString(arg) && 1 == Rf_length(arg) && NA_STRING != STRING_ELT(arg, 0))
201-
return 0;
202-
return -1;
203-
}
204-
205184
/**
206185
* Check fetch_heads argument
207186
*
@@ -398,6 +377,27 @@ git2r_arg_check_real(
398377
return 0;
399378
}
400379

380+
/**
381+
* Check proxy argument
382+
*
383+
* proxy may be NULL, TRUE or a string
384+
*
385+
* @param arg the arg to check
386+
* @return 0 if OK, else -1
387+
*/
388+
int attribute_hidden
389+
git2r_arg_check_proxy(
390+
SEXP arg)
391+
{
392+
if (Rf_isNull(arg))
393+
return 0;
394+
if (Rf_isLogical(arg) && 1 == Rf_length(arg) && NA_LOGICAL != LOGICAL(arg)[0])
395+
return 0;
396+
if (Rf_isString(arg) && 1 == Rf_length(arg) && NA_STRING != STRING_ELT(arg, 0))
397+
return 0;
398+
return -1;
399+
}
400+
401401
/**
402402
* Check repository argument
403403
*

src/git2r_arg.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ int git2r_arg_check_integer_gte_zero(SEXP arg);
3838
int git2r_arg_check_list(SEXP arg);
3939
int git2r_arg_check_logical(SEXP arg);
4040
int git2r_arg_check_note(SEXP arg);
41+
int git2r_arg_check_proxy(SEXP arg);
4142
int git2r_arg_check_repository(SEXP arg);
4243
int git2r_arg_check_same_repo(SEXP arg1, SEXP arg2);
4344
int git2r_arg_check_signature(SEXP arg);

0 commit comments

Comments
 (0)