We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b736983 commit 3854d1aCopy full SHA for 3854d1a
ext/rugged/rugged_repo.c
@@ -1174,13 +1174,12 @@ static VALUE rb_git_repo_get_head(VALUE self)
1174
static VALUE rb_git_repo_path(VALUE self)
1175
{
1176
git_repository *repo;
1177
- Data_Get_Struct(self, git_repository, repo);
+ const char *path;
1178
1179
- const char *path = git_repository_path(repo);
1180
- if (path == NULL)
1181
- return Qnil;
+ Data_Get_Struct(self, git_repository, repo);
+ path = git_repository_path(repo);
1182
1183
- return rb_str_new_utf8(path);
+ return path ? rb_str_new_utf8(path) : Qnil;
1184
}
1185
1186
/*
0 commit comments