Skip to content

Commit

Permalink
Repository.xs: Check type for new working directory in workdir()
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesg committed Apr 22, 2014
1 parent e397f70 commit db9b385
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions xs/Repository.xs
Original file line number Diff line number Diff line change
Expand Up @@ -922,9 +922,14 @@ workdir(self, ...)

CODE:
if (items == 2) {
const char *new_path = SvPVbyte_nolen(ST(1));
const char *new_dir = NULL;

rc = git_repository_set_workdir(self, new_path, 1);
if (!SvPOK(ST(1)))
Perl_croak(aTHX_ "Expected a string for 'new_dir'");

new_dir = SvPVbyte_nolen(ST(1));

rc = git_repository_set_workdir(self, new_dir, 1);
git_check_error(rc);
}

Expand Down

0 comments on commit db9b385

Please sign in to comment.