Re: [PATCHv6 4/4] status: better advices when splitting a commit (during rebase -i)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Kong Lucien <Lucien.Kong@xxxxxxxxxxxxxxx> writes:

> diff --git a/t/t7512-status-help.sh b/t/t7512-status-help.sh
> index 2bb43f3..0b7f231 100755
> --- a/t/t7512-status-help.sh
> +++ b/t/t7512-status-help.sh
> @@ -106,7 +106,7 @@ test_expect_success 'status when rebase in progress before rebase --continue' '
>  
>  test_expect_success 'status when rebasing -i in edit mode' '
>  	git init git &&
> -	test_when_finished "rm -rf git fake-editor.sh" &&
> +	test_when_finished "rm -rf git" &&

Hrph.  Is this an "oops" fixup of an earlier patch?

> @@ -130,6 +130,67 @@ test_expect_success 'status when rebasing -i in edit mode' '
> ...
> +test_expect_failure 'status after editing the last commit with --amend during a rebase -i' '
> +	git init git &&
> +	test_when_finished "rm -rf git fake-editor.sh" &&

You do not seem to remove fake-editor.sh in this test.  Why do you
remove it here?

> diff --git a/wt-status.c b/wt-status.c
> index 5034eee..bbb3370 100644
> --- a/wt-status.c
> +++ b/wt-status.c
> @@ -819,6 +820,69 @@ static void show_am_in_progress(struct wt_status *s,
>  	wt_status_print_trailer(s);
>  }
>  
> +static int split_commit_in_progress()
> +{
> +	int split_in_progress = 0;
> +
> +	FILE *head = fopen(git_path("HEAD"), "r");
> +	if (!head)
> +		return 0;
> +
> ...
> +	struct strbuf buf_head = STRBUF_INIT;
> +	struct strbuf buf_orig_head = STRBUF_INIT;
> +	struct strbuf buf_rebase_amend = STRBUF_INIT;
> +	struct strbuf buf_rebase_orig_head = STRBUF_INIT;


Please avoid decl-after-statement by declaring all variables at the
beginning of the function before the first statement.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]