summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2012-11-05 10:44:21 -0800
committerRussell Belfer <rb@github.com>2012-11-05 10:44:21 -0800
commit065be7a1d9779d72d7de5e9f963f7b6dc971e66e (patch)
tree11111d19011be08ed1e2f94d2f0b9f8c067e5831
parent942a76983bb3d2d1d6c8df434c1fe55f4763ca5d (diff)
parent221ee54b8ce67efb0346b7ace67728a14babfcac (diff)
downloadlibgit2-065be7a1d9779d72d7de5e9f963f7b6dc971e66e.tar.gz
Merge pull request #1044 from dahlbyk/repo/state
Fix state when HEAD is not detached
-rw-r--r--README.md2
-rw-r--r--src/repository.c3
-rw-r--r--tests-clar/repo/state.c2
3 files changed, 1 insertions, 6 deletions
diff --git a/README.md b/README.md
index 08687276e..403520b66 100644
--- a/README.md
+++ b/README.md
@@ -70,7 +70,7 @@ The following CMake variables are declared:
- `LIB_INSTALL_DIR`: Where to install libraries to.
- `INCLUDE_INSTALL_DIR`: Where to install headers to.
- `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)
Language Bindings
diff --git a/src/repository.c b/src/repository.c
index 0e416e0b8..fbae8935b 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -1552,9 +1552,6 @@ int git_repository_state(git_repository *repo)
assert(repo);
- if (!git_repository_head_detached(repo))
- return state;
-
if (git_buf_puts(&repo_path, repo->path_repository) < 0)
return -1;
diff --git a/tests-clar/repo/state.c b/tests-clar/repo/state.c
index c0aba1987..5a0a5f360 100644
--- a/tests-clar/repo/state.c
+++ b/tests-clar/repo/state.c
@@ -23,8 +23,6 @@ static void setup_simple_state(const char *filename)
cl_git_pass(git_buf_joinpath(&_path, git_repository_path(_repo), filename));
git_futils_mkpath2file(git_buf_cstr(&_path), 0777);
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)