"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: zap unused parameter in worktree.c:got_worktree_rebase_complete()
To:
Mark Jamsek <mark@jamsek.com>
Cc:
Game of Trees <gameoftrees@openbsd.org>
Date:
Tue, 31 Jan 2023 13:36:52 +0100

Download raw body.

Thread
On Tue, Jan 31, 2023 at 11:06:08PM +1100, Mark Jamsek wrote:
> More housekeeping: the struct got_reference 'new_base_branch'
> got_worktree_rebase_complete() parameter is not used so nix it.

Sure, ok.

> diff /home/mark/src/got
> commit - b0d06d6514ab190cbeaf9a355c3ffe9ac45363bd
> path + /home/mark/src/got
> blob - 0a7951d76aa6380eece25daefcd4b780508007ce
> file + got/got.c
> --- got/got.c
> +++ got/got.c
> @@ -10426,13 +10426,12 @@ rebase_complete(struct got_worktree *worktree, struct 
>  
>  static const struct got_error *
>  rebase_complete(struct got_worktree *worktree, struct got_fileindex *fileindex,
> -    struct got_reference *branch, struct got_reference *new_base_branch,
> -    struct got_reference *tmp_branch, struct got_repository *repo,
> -    int create_backup)
> +    struct got_reference *branch, struct got_reference *tmp_branch,
> +    struct got_repository *repo, int create_backup)
>  {
>  	printf("Switching work tree to %s\n", got_ref_get_name(branch));
>  	return got_worktree_rebase_complete(worktree, fileindex,
> -	    new_base_branch, tmp_branch, branch, repo, create_backup);
> +	    tmp_branch, branch, repo, create_backup);
>  }
>  
>  static const struct got_error *
> @@ -11250,8 +11249,7 @@ cmd_rebase(int argc, char *argv[])
>  	if (STAILQ_EMPTY(&commits)) {
>  		if (continue_rebase) {
>  			error = rebase_complete(worktree, fileindex,
> -			    branch, new_base_branch, tmp_branch, repo,
> -			    create_backup);
> +			    branch, tmp_branch, repo, create_backup);
>  			goto done;
>  		} else {
>  			/* Fast-forward the reference of the branch. */
> @@ -11336,7 +11334,7 @@ cmd_rebase(int argc, char *argv[])
>  		}
>  	} else
>  		error = rebase_complete(worktree, fileindex, branch,
> -		    new_base_branch, tmp_branch, repo, create_backup);
> +		    tmp_branch, repo, create_backup);
>  done:
>  	free(cwd);
>  	free(committer);
> blob - 444d64fb9897a4e6ab7664069d364358ec7bfacb
> file + include/got_worktree.h
> --- include/got_worktree.h
> +++ include/got_worktree.h
> @@ -332,7 +332,7 @@ const struct got_error *got_worktree_rebase_complete(s
>   */
>  const struct got_error *got_worktree_rebase_complete(struct got_worktree *,
>      struct got_fileindex *, struct got_reference *, struct got_reference *,
> -    struct got_reference *, struct got_repository *, int create_backup);
> +    struct got_repository *, int create_backup);
>  
>  /*
>   * Abort the current rebase operation.
> blob - 158fcd73c1c9600a23bfabea6968f055ea3e6f0f
> file + lib/worktree.c
> --- lib/worktree.c
> +++ lib/worktree.c
> @@ -7016,9 +7016,9 @@ got_worktree_rebase_complete(struct got_worktree *work
>  
>  const struct got_error *
>  got_worktree_rebase_complete(struct got_worktree *worktree,
> -    struct got_fileindex *fileindex, struct got_reference *new_base_branch,
> -    struct got_reference *tmp_branch, struct got_reference *rebased_branch,
> -    struct got_repository *repo, int create_backup)
> +    struct got_fileindex *fileindex, struct got_reference *tmp_branch,
> +    struct got_reference *rebased_branch, struct got_repository *repo,
> +    int create_backup)
>  {
>  	const struct got_error *err, *unlockerr, *sync_err;
>  	struct got_object_id *new_head_commit_id = NULL;
> 
> -- 
> Mark Jamsek <fnc.bsdbox.org>
> GPG: F2FF 13DE 6A06 C471 CA80  E6E2 2930 DC66 86EE CF68