summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre-Olivier Latour <pol@mac.com>2014-11-09 08:09:25 +0900
committerPierre-Olivier Latour <pol@mac.com>2014-11-10 08:18:48 +0900
commit692c040843dee45287d87ed81d4a1bd3684f5c97 (patch)
treeb6d4ee41ba08b67f436952b6f132b837f3e4b166
parent4865cc3f0631a8a4e0e1de897865df0e552c70cb (diff)
downloadlibgit2-692c040843dee45287d87ed81d4a1bd3684f5c97.tar.gz
Fixed a couple Clang warnings
-rw-r--r--src/checkout.c4
-rw-r--r--tests/status/worktree_init.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/checkout.c b/src/checkout.c
index 44e2f3b27..4e879e36f 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -1145,12 +1145,16 @@ static int checkout_conflict_append_remove(
checkout_data *data = payload;
const char *name;
+ assert(ancestor || ours || theirs);
+
if (ancestor)
name = git__strdup(ancestor->path);
else if (ours)
name = git__strdup(ours->path);
else if (theirs)
name = git__strdup(theirs->path);
+ else
+ abort();
GITERR_CHECK_ALLOC(name);
diff --git a/tests/status/worktree_init.c b/tests/status/worktree_init.c
index 3e43c8c20..cc7e126f1 100644
--- a/tests/status/worktree_init.c
+++ b/tests/status/worktree_init.c
@@ -127,7 +127,6 @@ void test_status_worktree_init__bracket_in_filename(void)
git_index *index;
status_entry_single result;
unsigned int status_flags;
- int error;
#define FILE_WITH_BRACKET "LICENSE[1].md"
#define FILE_WITHOUT_BRACKET "LICENSE1.md"