blame: remove unused parameters
Clean up blame code before moving it into libgit Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff Smith committed
May 24, 2017 at 00:15 UTC
8265921c3c70c757d68b76f2f013a4c6bd3c37d4
1 file changed
+10
-15
builtin/blame.c
+10
-15
@@ -449,9 +449,7 @@ static struct origin *make_origin(struct commit *commit, const char *path)
449
* Locate an existing origin or create a new one.
450
* This moves the origin to front position in the commit util list.
451
*/
452
-static struct origin *get_origin(struct scoreboard *sb,
453
- struct commit *commit,
454
- const char *path)
452
+static struct origin *get_origin(struct commit *commit, const char *path)
453
{
454
struct origin *o, *l;
455
@@ -499,8 +497,7 @@ static int fill_blob_sha1_and_mode(struct origin *origin)
497
* We have an origin -- check if the same path exists in the
498
* parent and return an origin structure to represent it.
499
*/
502
-static struct origin *find_origin(struct scoreboard *sb,
503
- struct commit *parent,
500
+static struct origin *find_origin(struct commit *parent,
501
struct origin *origin)
502
{
503
struct origin *porigin;
@@ -543,7 +540,7 @@ static struct origin *find_origin(struct scoreboard *sb,
540
541
if (!diff_queued_diff.nr) {
542
/* The path is the same as parent */
546
- porigin = get_origin(sb, parent, origin->path);
543
+ porigin = get_origin(parent, origin->path);
544
oidcpy(&porigin->blob_oid, &origin->blob_oid);
545
porigin->mode = origin->mode;
546
} else {
@@ -569,7 +566,7 @@ static struct origin *find_origin(struct scoreboard *sb,
566
die("internal error in blame::find_origin (%c)",
567
p->status);
568
case 'M':
572
- porigin = get_origin(sb, parent, origin->path);
569
+ porigin = get_origin(parent, origin->path);
570
oidcpy(&porigin->blob_oid, &p->one->oid);
571
porigin->mode = p->one->mode;
572
break;
@@ -588,8 +585,7 @@ static struct origin *find_origin(struct scoreboard *sb,
585
* We have an origin -- find the path that corresponds to it in its
586
* parent and return an origin structure to represent it.
587
*/
591
-static struct origin *find_rename(struct scoreboard *sb,
592
- struct commit *parent,
588
+static struct origin *find_rename(struct commit *parent,
589
struct origin *origin)
590
{
591
struct origin *porigin = NULL;
@@ -615,7 +611,7 @@ static struct origin *find_rename(struct scoreboard *sb,
611
struct diff_filepair *p = diff_queued_diff.queue[i];
612
if ((p->status == 'R' || p->status == 'C') &&
613
!strcmp(p->two->path, origin->path)) {
618
- porigin = get_origin(sb, parent, p->one->path);
614
+ porigin = get_origin(parent, p->one->path);
615
oidcpy(&porigin->blob_oid, &p->one->oid);
616
porigin->mode = p->one->mode;
617
break;
@@ -1270,7 +1266,7 @@ static void find_copy_in_parent(struct scoreboard *sb,
1266
/* find_move already dealt with this path */
1267
continue;
1268
1273
- norigin = get_origin(sb, parent, p->one->path);
1269
+ norigin = get_origin(parent, p->one->path);
1270
oidcpy(&norigin->blob_oid, &p->one->oid);
1271
norigin->mode = p->one->mode;
1272
fill_origin_blob(&sb->revs->diffopt, norigin, &file_p);
@@ -1404,8 +1400,7 @@ static void pass_blame(struct scoreboard *sb, struct origin *origin, int opt)
1400
* common cases, then we look for renames in the second pass.
1401
*/
1402
for (pass = 0; pass < 2 - no_whole_file_rename; pass++) {
1407
- struct origin *(*find)(struct scoreboard *,
1408
- struct commit *, struct origin *);
1403
+ struct origin *(*find)(struct commit *, struct origin *);
1404
find = pass ? find_rename : find_origin;
1405
1406
for (i = 0, sg = first_scapegoat(revs, commit);
@@ -1418,7 +1413,7 @@ static void pass_blame(struct scoreboard *sb, struct origin *origin, int opt)
1413
continue;
1414
if (parse_commit(p))
1415
continue;
1421
- porigin = find(sb, p, origin);
1416
+ porigin = find(p, origin);
1417
if (!porigin)
1418
continue;
1419
if (!oidcmp(&porigin->blob_oid, &origin->blob_oid)) {
@@ -2806,7 +2801,7 @@ parse_done:
2801
sb.final_buf_size = o->file.size;
2802
}
2803
else {
2809
- o = get_origin(&sb, sb.final, path);
2804
+ o = get_origin(sb.final, path);
2805
if (fill_blob_sha1_and_mode(o))
2806
die(_("no such path %s in %s"), path, final_commit_name);
2807