From: Junio C Hamano Date: Wed, 3 Sep 2008 21:51:56 +0000 (-0700) Subject: Merge branch 'ho/dashless' into maint X-Git-Tag: v1.6.0.2~23 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/36f44a06802960abce7febbf9cc40461e5546ee5?ds=inline;hp=-c Merge branch 'ho/dashless' into maint * ho/dashless: tests: use "git xyzzy" form (t7200 - t9001) tests: use "git xyzzy" form (t7000 - t7199) tests: use "git xyzzy" form (t3600 - t6999) tests: use "git xyzzy" form (t0000 - t3599) 'git foo' program identifies itself without dash in die() messages Start conforming code to "git subcmd" style --- 36f44a06802960abce7febbf9cc40461e5546ee5 diff --combined builtin-apply.c index 47261e10fb,4eb263ec58..20bef1f21d --- a/builtin-apply.c +++ b/builtin-apply.c @@@ -274,7 -274,7 +274,7 @@@ static void say_patch_name(FILE *output static void read_patch_file(struct strbuf *sb, int fd) { if (strbuf_read(sb, fd, 0) < 0) - die("git-apply: read returned %s", strerror(errno)); + die("git apply: read returned %s", strerror(errno)); /* * Make sure that we have some slop in the buffer @@@ -506,17 -506,17 +506,17 @@@ static char *gitdiff_verify_name(const name = orig_name; len = strlen(name); if (isnull) - die("git-apply: bad git-diff - expected /dev/null, got %s on line %d", name, linenr); + die("git apply: bad git-diff - expected /dev/null, got %s on line %d", name, linenr); another = find_name(line, NULL, p_value, TERM_TAB); if (!another || memcmp(another, name, len)) - die("git-apply: bad git-diff - inconsistent %s filename on line %d", oldnew, linenr); + die("git apply: bad git-diff - inconsistent %s filename on line %d", oldnew, linenr); free(another); return orig_name; } else { /* expect "/dev/null" */ if (memcmp("/dev/null", line, 9) || line[9] != '\n') - die("git-apply: bad git-diff - expected /dev/null on line %d", linenr); + die("git apply: bad git-diff - expected /dev/null on line %d", linenr); return NULL; } } @@@ -1996,8 -1996,6 +1996,8 @@@ static int apply_one_fragment(struct im /* * A hunk to change lines at the beginning would begin with * @@ -1,L +N,M @@ + * but we need to be careful. -U0 that inserts before the second + * line also has this pattern. * * And a hunk to add to an empty file would begin with * @@ -0,0 +N,M @@ @@@ -2005,8 -2003,7 +2005,8 @@@ * In other words, a hunk that is (frag->oldpos <= 1) with or * without leading context must match at the beginning. */ - match_beginning = frag->oldpos <= 1; + match_beginning = (!frag->oldpos || + (frag->oldpos == 1 && !unidiff_zero)); /* * A hunk without trailing lines must match at the end. diff --combined t/t5300-pack-object.sh index 83abe5f25e,482bc7ae68..3a0ef8759c --- a/t/t5300-pack-object.sh +++ b/t/t5300-pack-object.sh @@@ -3,7 -3,7 +3,7 @@@ # Copyright (c) 2005 Junio C Hamano # - test_description='git-pack-object + test_description='git pack-object ' . ./test-lib.sh @@@ -186,12 -186,6 +186,12 @@@ test_expect_success test-2-${packname_2}.idx \ test-3-${packname_3}.idx' +test_expect_success \ + 'verify pack -v' \ + 'git verify-pack -v test-1-${packname_1}.idx \ + test-2-${packname_2}.idx \ + test-3-${packname_3}.idx' + test_expect_success \ 'verify-pack catches mismatched .idx and .pack files' \ 'cat test-1-${packname_1}.idx >test-3.idx && @@@ -242,24 -236,24 +242,24 @@@ test_expect_success test_expect_success \ 'build pack index for an existing pack' \ 'cat test-1-${packname_1}.pack >test-3.pack && - git-index-pack -o tmp.idx test-3.pack && + git index-pack -o tmp.idx test-3.pack && cmp tmp.idx test-1-${packname_1}.idx && - git-index-pack test-3.pack && + git index-pack test-3.pack && cmp test-3.idx test-1-${packname_1}.idx && cat test-2-${packname_2}.pack >test-3.pack && - git-index-pack -o tmp.idx test-2-${packname_2}.pack && + git index-pack -o tmp.idx test-2-${packname_2}.pack && cmp tmp.idx test-2-${packname_2}.idx && - git-index-pack test-3.pack && + git index-pack test-3.pack && cmp test-3.idx test-2-${packname_2}.idx && cat test-3-${packname_3}.pack >test-3.pack && - git-index-pack -o tmp.idx test-3-${packname_3}.pack && + git index-pack -o tmp.idx test-3-${packname_3}.pack && cmp tmp.idx test-3-${packname_3}.idx && - git-index-pack test-3.pack && + git index-pack test-3.pack && cmp test-3.idx test-3-${packname_3}.idx && :' @@@ -272,7 -266,7 +272,7 @@@ test_expect_success test_expect_success \ 'make sure index-pack detects the SHA1 collision' \ - 'test_must_fail git-index-pack -o bad.idx test-3.pack' + 'test_must_fail git index-pack -o bad.idx test-3.pack' test_expect_success \ 'honor pack.packSizeLimit' \