Commit 48ce97dd968f7eb8af1bb46b043dc1ae1bdf1b46

nulltoken 2012-05-13T11:03:29

branch: cover with test that moving a non existing branch returns ENOTFOUND

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/tests-clar/refs/branches/move.c b/tests-clar/refs/branches/move.c
index 208bb46..242e5cd 100644
--- a/tests-clar/refs/branches/move.c
+++ b/tests-clar/refs/branches/move.c
@@ -60,3 +60,13 @@ void test_refs_branches_move__can_not_move_a_branch_through_its_canonical_name(v
 {
 	cl_git_fail(git_branch_move(repo, "refs/heads/br2", NEW_BRANCH_NAME, 1));
 }
+
+void test_refs_branches_move__moving_a_non_exisiting_branch_returns_ENOTFOUND(void)
+{
+	int error;
+
+	error = git_branch_move(repo, "where/am/I", NEW_BRANCH_NAME, 0);
+	cl_git_fail(error);
+
+	cl_assert_equal_i(GIT_ENOTFOUND, error);
+}