THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Bläddra i källkod

Merge branch 'mp/for-each-ref-missing-name-or-email'

"for-each-ref" and friends that shows refs did not protect themselves
against ancient tags that did not record tagger names when asked to
show "%(taggername)", which have been corrected.

* mp/for-each-ref-missing-name-or-email:
  ref-filter: initialize empty name or email fields
tags/v2.24.0-rc0
Junio C Hamano 2 månader sedan
förälder
incheckning
a477abe9e4
2 ändrade filer med 22 tillägg och 3 borttagningar
  1. +3
    -3
      ref-filter.c
  2. +19
    -0
      t/t6300-for-each-ref.sh

+ 3
- 3
ref-filter.c Visa fil

@@ -1028,7 +1028,7 @@ static const char *copy_name(const char *buf)
if (!strncmp(cp, " <", 2))
return xmemdupz(buf, cp - buf);
}
return "";
return xstrdup("");
}

static const char *copy_email(const char *buf)
@@ -1036,10 +1036,10 @@ static const char *copy_email(const char *buf)
const char *email = strchr(buf, '<');
const char *eoemail;
if (!email)
return "";
return xstrdup("");
eoemail = strchr(email, '>');
if (!eoemail)
return "";
return xstrdup("");
return xmemdupz(email, eoemail + 1 - email);
}



+ 19
- 0
t/t6300-for-each-ref.sh Visa fil

@@ -526,6 +526,25 @@ test_expect_success 'Check ambiguous head and tag refs II (loose)' '
test_cmp expected actual
'

test_expect_success 'create tag without tagger' '
git tag -a -m "Broken tag" taggerless &&
git tag -f taggerless $(git cat-file tag taggerless |
sed -e "/^tagger /d" |
git hash-object --stdin -w -t tag)
'

test_atom refs/tags/taggerless type 'commit'
test_atom refs/tags/taggerless tag 'taggerless'
test_atom refs/tags/taggerless tagger ''
test_atom refs/tags/taggerless taggername ''
test_atom refs/tags/taggerless taggeremail ''
test_atom refs/tags/taggerless taggerdate ''
test_atom refs/tags/taggerless committer ''
test_atom refs/tags/taggerless committername ''
test_atom refs/tags/taggerless committeremail ''
test_atom refs/tags/taggerless committerdate ''
test_atom refs/tags/taggerless subject 'Broken tag'

test_expect_success 'an unusual tag with an incomplete line' '

git tag -m "bogo" bogo &&


Laddar…
Avbryt
Spara