summaryrefslogtreecommitdiff
path: root/t/t7006-pager.sh
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2014-06-18 15:48:29 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-06-20 10:44:45 -0700
commit95b567c7c3cf6b85d74b79424cdfbd40a7dee7c9 (patch)
treee150b9f71b846bb3245577b55b9ba536bf5a6bfd /t/t7006-pager.sh
parentuse skip_prefix to avoid magic numbers (diff)
downloadtgif-95b567c7c3cf6b85d74b79424cdfbd40a7dee7c9.tar.xz
use skip_prefix to avoid repeating strings
It's a common idiom to match a prefix and then skip past it with strlen, like: if (starts_with(foo, "bar")) foo += strlen("bar"); This avoids magic numbers, but means we have to repeat the string (and there is no compiler check that we didn't make a typo in one of the strings). We can use skip_prefix to handle this case without repeating ourselves. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7006-pager.sh')
0 files changed, 0 insertions, 0 deletions