Skip to content

Commit 8265921

Browse files
whydoubtgitster
authored andcommitted
blame: remove unused parameters
Clean up blame code before moving it into libgit Signed-off-by: Jeff Smith <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3a35cb2 commit 8265921

File tree

1 file changed

+10
-15
lines changed

1 file changed

+10
-15
lines changed

builtin/blame.c

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,7 @@ static struct origin *make_origin(struct commit *commit, const char *path)
449449
* Locate an existing origin or create a new one.
450450
* This moves the origin to front position in the commit util list.
451451
*/
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)
455453
{
456454
struct origin *o, *l;
457455

@@ -499,8 +497,7 @@ static int fill_blob_sha1_and_mode(struct origin *origin)
499497
* We have an origin -- check if the same path exists in the
500498
* parent and return an origin structure to represent it.
501499
*/
502-
static struct origin *find_origin(struct scoreboard *sb,
503-
struct commit *parent,
500+
static struct origin *find_origin(struct commit *parent,
504501
struct origin *origin)
505502
{
506503
struct origin *porigin;
@@ -543,7 +540,7 @@ static struct origin *find_origin(struct scoreboard *sb,
543540

544541
if (!diff_queued_diff.nr) {
545542
/* The path is the same as parent */
546-
porigin = get_origin(sb, parent, origin->path);
543+
porigin = get_origin(parent, origin->path);
547544
oidcpy(&porigin->blob_oid, &origin->blob_oid);
548545
porigin->mode = origin->mode;
549546
} else {
@@ -569,7 +566,7 @@ static struct origin *find_origin(struct scoreboard *sb,
569566
die("internal error in blame::find_origin (%c)",
570567
p->status);
571568
case 'M':
572-
porigin = get_origin(sb, parent, origin->path);
569+
porigin = get_origin(parent, origin->path);
573570
oidcpy(&porigin->blob_oid, &p->one->oid);
574571
porigin->mode = p->one->mode;
575572
break;
@@ -588,8 +585,7 @@ static struct origin *find_origin(struct scoreboard *sb,
588585
* We have an origin -- find the path that corresponds to it in its
589586
* parent and return an origin structure to represent it.
590587
*/
591-
static struct origin *find_rename(struct scoreboard *sb,
592-
struct commit *parent,
588+
static struct origin *find_rename(struct commit *parent,
593589
struct origin *origin)
594590
{
595591
struct origin *porigin = NULL;
@@ -615,7 +611,7 @@ static struct origin *find_rename(struct scoreboard *sb,
615611
struct diff_filepair *p = diff_queued_diff.queue[i];
616612
if ((p->status == 'R' || p->status == 'C') &&
617613
!strcmp(p->two->path, origin->path)) {
618-
porigin = get_origin(sb, parent, p->one->path);
614+
porigin = get_origin(parent, p->one->path);
619615
oidcpy(&porigin->blob_oid, &p->one->oid);
620616
porigin->mode = p->one->mode;
621617
break;
@@ -1270,7 +1266,7 @@ static void find_copy_in_parent(struct scoreboard *sb,
12701266
/* find_move already dealt with this path */
12711267
continue;
12721268

1273-
norigin = get_origin(sb, parent, p->one->path);
1269+
norigin = get_origin(parent, p->one->path);
12741270
oidcpy(&norigin->blob_oid, &p->one->oid);
12751271
norigin->mode = p->one->mode;
12761272
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)
14041400
* common cases, then we look for renames in the second pass.
14051401
*/
14061402
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 *);
14091404
find = pass ? find_rename : find_origin;
14101405

14111406
for (i = 0, sg = first_scapegoat(revs, commit);
@@ -1418,7 +1413,7 @@ static void pass_blame(struct scoreboard *sb, struct origin *origin, int opt)
14181413
continue;
14191414
if (parse_commit(p))
14201415
continue;
1421-
porigin = find(sb, p, origin);
1416+
porigin = find(p, origin);
14221417
if (!porigin)
14231418
continue;
14241419
if (!oidcmp(&porigin->blob_oid, &origin->blob_oid)) {
@@ -2806,7 +2801,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
28062801
sb.final_buf_size = o->file.size;
28072802
}
28082803
else {
2809-
o = get_origin(&sb, sb.final, path);
2804+
o = get_origin(sb.final, path);
28102805
if (fill_blob_sha1_and_mode(o))
28112806
die(_("no such path %s in %s"), path, final_commit_name);
28122807

0 commit comments

Comments
 (0)