From bfded8757032ea7095ed688a1065c9767016e509 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 30 Nov 2020 18:46:46 -0600 Subject: [PATCH 1/6] refspec: trivial cleanup We can remove one level of indentation and make the code clearer. No functional changes. Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- refspec.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/refspec.c b/refspec.c index c49347c2d7..d4823dbff9 100644 --- a/refspec.c +++ b/refspec.c @@ -272,15 +272,16 @@ void refspec_ref_prefixes(const struct refspec *rs, else if (item->src && !item->exact_sha1) prefix = item->src; - if (prefix) { - if (item->pattern) { - const char *glob = strchr(prefix, '*'); - strvec_pushf(ref_prefixes, "%.*s", - (int)(glob - prefix), - prefix); - } else { - expand_ref_prefix(ref_prefixes, prefix); - } + if (!prefix) + continue; + + if (item->pattern) { + const char *glob = strchr(prefix, '*'); + strvec_pushf(ref_prefixes, "%.*s", + (int)(glob - prefix), + prefix); + } else { + expand_ref_prefix(ref_prefixes, prefix); } } } From 02b5aa5825feed6d26e82d827050c8f97c212212 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 30 Nov 2020 18:46:47 -0600 Subject: [PATCH 2/6] .gitignore: remove dangling file The library was removed 7 years ago on commit ae34ac126f. But not from the .gitignore file. Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index f85d02c854..7c5096aee5 100644 --- a/.gitignore +++ b/.gitignore @@ -135,7 +135,6 @@ /git-remote-ftps /git-remote-fd /git-remote-ext -/git-remote-testpy /git-repack /git-replace /git-request-pull From b64b43d2f255067ddc047fbf89e5292e892665d5 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 30 Nov 2020 18:46:48 -0600 Subject: [PATCH 3/6] test: completion: fix typos Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- t/t9902-completion.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 5c01c75d40..81a728c743 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -906,7 +906,7 @@ test_expect_success '__git_refs - after --opt= - full refs' ' test_cmp expected "$actual" ' -test_expect_success '__git refs - exluding refs' ' +test_expect_success '__git refs - excluding refs' ' cat >expected <<-EOF && ^HEAD ^master @@ -922,7 +922,7 @@ test_expect_success '__git refs - exluding refs' ' test_cmp expected "$actual" ' -test_expect_success '__git refs - exluding full refs' ' +test_expect_success '__git refs - excluding full refs' ' cat >expected <<-EOF && ^refs/heads/master ^refs/heads/matching-branch From 1ab7e00e244d0feb50abc316cb870446724c9ef6 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Mon, 30 Nov 2020 18:46:49 -0600 Subject: [PATCH 4/6] tests: lib-functions: trivial style cleanups Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- t/test-lib-functions.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh index 7ba3011b90..a791f2f1d6 100644 --- a/t/test-lib-functions.sh +++ b/t/test-lib-functions.sh @@ -955,7 +955,7 @@ test_expect_code () { # - cmp's output is not nearly as easy to read as diff -u # - not all diff versions understand "-u" -test_cmp() { +test_cmp () { eval "$GIT_TEST_CMP" '"$@"' } @@ -968,7 +968,7 @@ test_cmp() { # # test_cmp_config foo core.bar # -test_cmp_config() { +test_cmp_config () { local GD && if test "$1" = "-C" then @@ -984,7 +984,7 @@ test_cmp_config() { # test_cmp_bin - helper to compare binary files -test_cmp_bin() { +test_cmp_bin () { cmp "$@" } @@ -1418,7 +1418,7 @@ nongit () { # whitespace and put in a single packet. Note that data containing NULs must be # given on stdin, and that empty input becomes an empty packet, not a flush # packet (for that you can just print 0000 yourself). -packetize() { +packetize () { if test $# -gt 0 then packet="$*" From f580de2f4100a532fac6b45934303235cb6e7f16 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 1 Dec 2020 21:26:24 -0500 Subject: [PATCH 5/6] gitignore: drop duplicate entry for git-sh-i18n This was accidentally added by e00cf070a4 (git-sh-i18n.sh: add no-op gettext() and eval_gettext() wrappers, 2011-05-14), even though an earlier commit in the same series had already done so. Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 7c5096aee5..e08d179428 100644 --- a/.gitignore +++ b/.gitignore @@ -151,7 +151,6 @@ /git-sh-i18n /git-sh-i18n--envsubst /git-sh-setup -/git-sh-i18n /git-shell /git-shortlog /git-show From 2fbd305e70934f064508ffc454d59351a7b132bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Wed, 2 Dec 2020 12:46:01 +0100 Subject: [PATCH 6/6] gitignore: remove entry for git serve MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit b7ce24d095 (Turn `git serve` into a test helper, 2019-04-18) demoted git serve from a builtin command to a test helper. As a result the git-serve binary is no longer built and thus doesn't have to be ignored anymore. Signed-off-by: René Scharfe Signed-off-by: Junio C Hamano --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index e08d179428..7c4dff2095 100644 --- a/.gitignore +++ b/.gitignore @@ -147,7 +147,6 @@ /git-rm /git-send-email /git-send-pack -/git-serve /git-sh-i18n /git-sh-i18n--envsubst /git-sh-setup