[PATCH 0/3] Trivial patches

STALE3750d

Revision v1 of 7 in this series.

6 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH 0/3] Trivial patches

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:35

Felipe Contreras (3):
  sequencer: trivial fix
  test: improve rebase -q test
  submodule: remove unnecessary check

 sequencer.c       | 7 +++++--
 submodule.c       | 5 ++---
 t/t3400-rebase.sh | 1 +
 3 files changed, 8 insertions(+), 5 deletions(-)

-- 
1.8.3.698.g079b096

[PATCH 1/3] sequencer: trivial fix

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:35

We should free objects before leaving.

Signed-off-by: Felipe Contreras <redacted>
---
 sequencer.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/sequencer.c b/sequencer.c
index ab6f8a7..7eeae2f 100644
--- a/sequencer.c
+++ b/sequencer.c
@@ -626,12 +626,15 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
 		rerere(opts->allow_rerere_auto);
 	} else {
 		int allow = allow_empty(opts, commit);
-		if (allow < 0)
-			return allow;
+		if (allow < 0) {
+			res = allow;
+			goto leave;
+		}
 		if (!opts->no_commit)
 			res = run_git_commit(defmsg, opts, allow);
 	}
 
+leave:
 	free_message(&msg);
 	free(defmsg);
 
-- 
1.8.3.698.g079b096

[PATCH 3/3] submodule: remove unnecessary check

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:35

read_cache() already does that check.

Signed-off-by: Felipe Contreras <redacted>
---
 submodule.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/submodule.c b/submodule.c
index ad476ce..8685424 100644
--- a/submodule.c
+++ b/submodule.c
@@ -603,9 +603,8 @@ int fetch_populated_submodules(const struct argv_array *options,
 	if (!work_tree)
 		goto out;
 
-	if (!the_index.initialized)
-		if (read_cache() < 0)
-			die("index file corrupt");
+	if (read_cache() < 0)
+		die("index file corrupt");
 
 	argv_array_push(&argv, "fetch");
 	for (i = 0; i < options->argc; i++)
-- 
1.8.3.698.g079b096

[PATCH 2/3] test: improve rebase -q test

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:35

Let's show the output so it's clear why it failed.

Signed-off-by: Felipe Contreras <redacted>
---
 t/t3400-rebase.sh | 1 +
 1 file changed, 1 insertion(+)
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index b58fa1a..fb39531 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -185,6 +185,7 @@ test_expect_success 'default to @{upstream} when upstream arg is missing' '
 test_expect_success 'rebase -q is quiet' '
 	git checkout -b quiet topic &&
 	git rebase -q master >output.out 2>&1 &&
+	cat output.out &&
 	test ! -s output.out
 '
 
-- 
1.8.3.698.g079b096

Re: [PATCH 2/3] test: improve rebase -q test

From: Duy Nguyen <hidden>
Date: 2016-06-15 22:57:36

On Sat, Jun 8, 2013 at 3:32 AM, Felipe Contreras
[off-list ref] wrote:
Let's show the output so it's clear why it failed.
I think you can always look into trash-directory.t3400 and figure why.
But if you show this, I think you should use test_cmp to make it clear
what is not wanted. Something like

: >expected &&
test_cmp expected output.out
quoted hunk
Signed-off-by: Felipe Contreras <redacted>
---
 t/t3400-rebase.sh | 1 +
 1 file changed, 1 insertion(+)
diff --git a/t/t3400-rebase.sh b/t/t3400-rebase.sh
index b58fa1a..fb39531 100755
--- a/t/t3400-rebase.sh
+++ b/t/t3400-rebase.sh
@@ -185,6 +185,7 @@ test_expect_success 'default to @{upstream} when upstream arg is missing' '
 test_expect_success 'rebase -q is quiet' '
        git checkout -b quiet topic &&
        git rebase -q master >output.out 2>&1 &&
+       cat output.out &&
        test ! -s output.out
 '

--
1.8.3.698.g079b096

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
Duy

Re: [PATCH 2/3] test: improve rebase -q test

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:36

On Fri, Jun 7, 2013 at 9:44 PM, Duy Nguyen [off-list ref] wrote:
On Sat, Jun 8, 2013 at 3:32 AM, Felipe Contreras
[off-list ref] wrote:
quoted
Let's show the output so it's clear why it failed.
I think you can always look into trash-directory.t3400 and figure why.
But if you show this, I think you should use test_cmp to make it clear
what is not wanted. Something like

: >expected &&
test_cmp expected output.out
Feel free to send that patch. I'm done with this one.

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help