Removed some useless variable assignments
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
diff --git a/src/describe.c b/src/describe.c
index fb39c58..2640c1c 100644
--- a/src/describe.c
+++ b/src/describe.c
@@ -571,8 +571,6 @@ static int describe(
}
}
- best = (struct possible_tag *)git_vector_get(&all_matches, 0);
-
git_vector_sort(&all_matches);
best = (struct possible_tag *)git_vector_get(&all_matches, 0);
diff --git a/src/diff_tform.c b/src/diff_tform.c
index 9ebce06..d576317 100644
--- a/src/diff_tform.c
+++ b/src/diff_tform.c
@@ -949,8 +949,6 @@ find_best_matches:
* Rewrite the diffs with renames / copies
*/
- tried_tgts = 0;
-
git_vector_foreach(&diff->deltas, t, tgt) {
/* skip things that are not rename targets */
if ((tgt->flags & GIT_DIFF_FLAG__IS_RENAME_TARGET) == 0)
diff --git a/src/oid.c b/src/oid.c
index 969931d..5d29200 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -211,7 +211,7 @@ int git_oid_ncmp(const git_oid *oid_a, const git_oid *oid_b, size_t len)
int git_oid_strcmp(const git_oid *oid_a, const char *str)
{
- const unsigned char *a = oid_a->id;
+ const unsigned char *a;
unsigned char strval;
int hexval;
diff --git a/src/pack.c b/src/pack.c
index 516e0f3..7903238 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -1105,7 +1105,6 @@ int git_packfile_alloc(struct git_pack_file **pack_out, const char *path)
p->pack_keep = 1;
memcpy(p->pack_name + root_len, ".pack", sizeof(".pack"));
- path_len = path_len - strlen(".idx") + strlen(".pack");
}
if (p_stat(p->pack_name, &st) < 0 || !S_ISREG(st.st_mode)) {