Commit 065be7a1 by Russell Belfer

Merge pull request #1044 from dahlbyk/repo/state

Fix state when HEAD is not detached
parents 942a7698 221ee54b
...@@ -70,7 +70,7 @@ The following CMake variables are declared: ...@@ -70,7 +70,7 @@ The following CMake variables are declared:
- `LIB_INSTALL_DIR`: Where to install libraries to. - `LIB_INSTALL_DIR`: Where to install libraries to.
- `INCLUDE_INSTALL_DIR`: Where to install headers to. - `INCLUDE_INSTALL_DIR`: Where to install headers to.
- `BUILD_SHARED_LIBS`: Build libgit2 as a Shared Library (defaults to ON) - `BUILD_SHARED_LIBS`: Build libgit2 as a Shared Library (defaults to ON)
- `BUILD_CLAR`: Build [Clar](https://github.com/tanoku/clar)-based test suite (defaults to ON) - `BUILD_CLAR`: Build [Clar](https://github.com/vmg/clar)-based test suite (defaults to ON)
- `THREADSAFE`: Build libgit2 with threading support (defaults to OFF) - `THREADSAFE`: Build libgit2 with threading support (defaults to OFF)
Language Bindings Language Bindings
......
...@@ -1552,9 +1552,6 @@ int git_repository_state(git_repository *repo) ...@@ -1552,9 +1552,6 @@ int git_repository_state(git_repository *repo)
assert(repo); assert(repo);
if (!git_repository_head_detached(repo))
return state;
if (git_buf_puts(&repo_path, repo->path_repository) < 0) if (git_buf_puts(&repo_path, repo->path_repository) < 0)
return -1; return -1;
......
...@@ -23,8 +23,6 @@ static void setup_simple_state(const char *filename) ...@@ -23,8 +23,6 @@ static void setup_simple_state(const char *filename)
cl_git_pass(git_buf_joinpath(&_path, git_repository_path(_repo), filename)); cl_git_pass(git_buf_joinpath(&_path, git_repository_path(_repo), filename));
git_futils_mkpath2file(git_buf_cstr(&_path), 0777); git_futils_mkpath2file(git_buf_cstr(&_path), 0777);
cl_git_mkfile(git_buf_cstr(&_path), "dummy"); cl_git_mkfile(git_buf_cstr(&_path), "dummy");
cl_git_pass(git_repository_detach_head(_repo));
} }
static void assert_repo_state(git_repository_state_t state) static void assert_repo_state(git_repository_state_t state)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment