summaryrefslogtreecommitdiff
path: root/t/t4106-apply-stdin.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-10-17 00:10:00 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-10-18 06:12:01 +0900
commit7ccc94ff4590cd035b7f78dfd9debbd7e692f3e6 (patch)
treebcfd7998cec2c940276f4f8216c9fd490d6cfc19 /t/t4106-apply-stdin.sh
parentcheck-ref-format --branch: do not expand @{...} outside repository (diff)
downloadtgif-7ccc94ff4590cd035b7f78dfd9debbd7e692f3e6.tar.xz
check-ref-format --branch: strip refs/heads/ using skip_prefix
The expansion returned from strbuf_check_branch_ref always starts with "refs/heads/" by construction, but there is nothing about its name or advertised API making that obvious. This command is used to process human-supplied input from the command line and is usually not the inner loop, so we can spare some cycles to be more defensive. Instead of hard-coding the offset strlen("refs/heads/") to skip, verify that the expansion actually starts with refs/heads/. [jn: split out from a larger patch, added explanation] Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4106-apply-stdin.sh')
0 files changed, 0 insertions, 0 deletions