Method: Rugged::Repository#workdir

Defined in:
ext/rugged/rugged_repo.c

#workdirnil

Return the working directory for this repository, or nil if the repository is bare.

repo1.bare? #=> false
repo1.workdir #=> "/home/foo/workthing/"

repo2.bare? #=> true
repo2.workdir #=> nil

Returns:

  • (nil)
[View source]

1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
# File 'ext/rugged/rugged_repo.c', line 1567

static VALUE rb_git_repo_workdir(VALUE self)
{
	git_repository *repo;
	const char *workdir;

	Data_Get_Struct(self, git_repository, repo);
	workdir = git_repository_workdir(repo);

	return workdir ? rb_str_new_utf8(workdir) : Qnil;
}