diff options
58 files changed, 384 insertions, 173 deletions
@@ -5,6 +5,7 @@ # same person appearing not to be so. # +Alex Bennée <kernel-hacker@bennee.com> Alexander Gavrilov <angavrilov@gmail.com> Aneesh Kumar K.V <aneesh.kumar@gmail.com> Brian M. Carlson <sandals@crustytoothpaste.ath.cx> @@ -15,6 +16,7 @@ Daniel Barkalow <barkalow@iabervon.org> David D. Kilzer <ddkilzer@kilzer.net> David Kågedal <davidk@lysator.liu.se> David S. Miller <davem@davemloft.net> +Deskin Miller <deskinm@umich.edu> Dirk Süsserott <newsletter@dirk.my1.cc> Fredrik Kuivinen <freku045@student.liu.se> H. Peter Anvin <hpa@bonde.sc.orionmulti.com> @@ -60,6 +62,7 @@ Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de> Uwe Kleine-König <uzeisberger@io.fsforth.de> Uwe Kleine-König <zeisberg@informatik.uni-freiburg.de> Ville Skyttä <scop@xemacs.org> +Vitaly "_Vi" Shukela <public_vi@tut.by> William Pursell <bill.pursell@gmail.com> YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> anonymous <linux@horizon.com> diff --git a/Documentation/Makefile b/Documentation/Makefile index 8a8a3954dc..04f69cf64e 100644 --- a/Documentation/Makefile +++ b/Documentation/Makefile @@ -264,7 +264,9 @@ manpage-base-url.xsl: manpage-base-url.xsl.in mv $@+ $@ user-manual.xml: user-manual.txt user-manual.conf - $(QUIET_ASCIIDOC)$(ASCIIDOC) $(ASCIIDOC_EXTRA) -b docbook -d book $< + $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \ + $(ASCIIDOC) $(ASCIIDOC_EXTRA) -b docbook -d book -o $@+ $< && \ + mv $@+ $@ technical/api-index.txt: technical/api-index-skel.txt \ technical/api-index.sh $(patsubst %,%.txt,$(API_DOCS)) @@ -278,7 +280,9 @@ XSLT = docbook.xsl XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css user-manual.html: user-manual.xml - $(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@ $(XSLT) $< + $(QUIET_XSLTPROC)$(RM) $@+ $@ && \ + xsltproc $(XSLTOPTS) -o $@+ $(XSLT) $< && \ + mv $@+ $@ git.info: user-manual.texi $(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi diff --git a/Documentation/RelNotes-1.7.0.4.txt b/Documentation/RelNotes-1.7.0.4.txt new file mode 100644 index 0000000000..cf7f60e60d --- /dev/null +++ b/Documentation/RelNotes-1.7.0.4.txt @@ -0,0 +1,27 @@ +Git v1.7.0.4 Release Notes +========================== + +Fixes since v1.7.0.3 +-------------------- + + * Optimized ntohl/htonl on big-endian machines were broken. + + * Color values given to "color.<cmd>.<slot>" configuration can now have + more than one attributes (e.g. "bold ul"). + + * "git add -u nonexistent-path" did not complain. + + * "git apply --whitespace=fix" didn't work well when an early patch in + a patch series adds trailing blank lines and a later one depended on + such a block of blank lines at the end. + + * "git fast-export" didn't check error status and stop when marks file + cannot be opened. + + * "git format-patch --ignore-if-in-upstream" gave unwarranted errors + when the range was empty, instead of silently finishing. + + * "git remote prune" did not detect remote tracking refs that became + dangling correctly. + +And other minor fixes and documentation updates. diff --git a/Documentation/RelNotes-1.7.0.5.txt b/Documentation/RelNotes-1.7.0.5.txt new file mode 100644 index 0000000000..3149c91b7b --- /dev/null +++ b/Documentation/RelNotes-1.7.0.5.txt @@ -0,0 +1,26 @@ +Git v1.7.0.5 Release Notes +========================== + +Fixes since v1.7.0.4 +-------------------- + + * "git daemon" failed to compile on platforms without sockaddr_storage type. + + * Output from "git rev-list --pretty=oneline" was unparsable when a + commit did not have any message, which is abnormal but possible in a + repository converted from foreign scm. + + * "git stash show <commit-that-is-not-a-stash>" gave an error message + that was not so useful. Reworded the message to "<it> is not a + stash". + + * Python scripts in contrib/ area now start with "#!/usr/bin/env python" + to honor user's PATH. + + * "git imap-send" used to mistake any line that begins with "From " as a + message separator in format-patch output. + + * Smart http server backend failed to report an internal server error and + infinitely looped instead after output pipe was closed. + +And other minor fixes and documentation updates. diff --git a/Documentation/blame-options.txt b/Documentation/blame-options.txt index 4833cac4b9..d8205691c6 100644 --- a/Documentation/blame-options.txt +++ b/Documentation/blame-options.txt @@ -79,14 +79,15 @@ of lines before or after the line given by <start>. of the --date option at linkgit:git-log[1]. -M|<num>|:: - Detect moving lines in the file as well. When a commit - moves a block of lines in a file (e.g. the original file - has A and then B, and the commit changes it to B and - then A), the traditional 'blame' algorithm typically blames - the lines that were moved up (i.e. B) to the parent and - assigns blame to the lines that were moved down (i.e. A) - to the child commit. With this option, both groups of lines - are blamed on the parent. + Detect moved or copied lines within a file. When a commit + moves or copies a block of lines (e.g. the original file + has A and then B, and the commit changes it to B and then + A), the traditional 'blame' algorithm notices only half of + the movement and typically blames the lines that were moved + up (i.e. B) to the parent and assigns blame to the lines that + were moved down (i.e. A) to the child commit. With this + option, both groups of lines are blamed on the parent by + running extra passes of inspection. + <num> is optional but it is the lower bound on the number of alphanumeric characters that git must detect as moving @@ -94,7 +95,7 @@ within a file for it to associate those lines with the parent commit. -C|<num>|:: - In addition to `-M`, detect lines copied from other + In addition to `-M`, detect lines moved or copied from other files that were modified in the same commit. This is useful when you reorganize your program and move code around across files. When this option is given twice, diff --git a/Documentation/config.txt b/Documentation/config.txt index 437b4ac5ee..75b8afec09 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -885,7 +885,7 @@ format.signoff:: gc.aggressiveWindow:: The window size parameter used in the delta compression algorithm used by 'git gc --aggressive'. This defaults - to 10. + to 250. gc.auto:: When there are approximately more than this many loose diff --git a/Documentation/diff-options.txt b/Documentation/diff-options.txt index 8707d0e740..a1191d647b 100644 --- a/Documentation/diff-options.txt +++ b/Documentation/diff-options.txt @@ -94,8 +94,8 @@ Also, when `--raw` or `--numstat` has been given, do not munge pathnames and use NULs as output field terminators. endif::git-log[] ifndef::git-log[] - When `--raw` or `--numstat` has been given, do not munge - pathnames and use NULs as output field terminators. + When `--raw`, `--numstat`, `--name-only` or `--name-status` has been + given, do not munge pathnames and use NULs as output field terminators. endif::git-log[] + Without this option, each pathname output will have TAB, LF, double quotes, diff --git a/Documentation/git-branch.txt b/Documentation/git-branch.txt index 6b6c3da2d9..60fa684b1d 100644 --- a/Documentation/git-branch.txt +++ b/Documentation/git-branch.txt @@ -63,7 +63,9 @@ way to clean up all obsolete remote-tracking branches. OPTIONS ------- -d:: - Delete a branch. The branch must be fully merged in HEAD. + Delete a branch. The branch must be fully merged in its + upstream branch, or in `HEAD` if no upstream was set with + `--track` or `--set-upstream`. -D:: Delete a branch irrespective of its merged status. @@ -72,6 +74,8 @@ OPTIONS Create the branch's reflog. This activates recording of all changes made to the branch ref, enabling use of date based sha1 expressions such as "<branchname>@\{yesterday}". + Note that in non-bare repositories, reflogs are usually + enabled by default by the `core.logallrefupdates` config option. -f:: --force:: diff --git a/Documentation/git-fetch.txt b/Documentation/git-fetch.txt index 948ea26c5a..400fe7f956 100644 --- a/Documentation/git-fetch.txt +++ b/Documentation/git-fetch.txt @@ -8,13 +8,13 @@ git-fetch - Download objects and refs from another repository SYNOPSIS -------- -'git fetch' <options> <repository> <refspec>... +'git fetch' [<options>] [<repository> [<refspec>...]] -'git fetch' <options> <group> +'git fetch' [<options>] <group> -'git fetch' --multiple <options> [<repository> | <group>]... +'git fetch' --multiple [<options>] [<repository> | <group>]... -'git fetch' --all <options> +'git fetch' --all [<options>] DESCRIPTION diff --git a/Documentation/git-http-backend.txt b/Documentation/git-http-backend.txt index 5238820657..277d9e141b 100644 --- a/Documentation/git-http-backend.txt +++ b/Documentation/git-http-backend.txt @@ -35,7 +35,7 @@ These services can be enabled/disabled using the per-repository configuration file: http.getanyfile:: - This serves older Git clients which are unable to use the + This serves Git clients older than version 1.6.6 that are unable to use the upload pack service. When enabled, clients are able to read any file within the repository, including objects that are no longer reachable from a branch but are still present. diff --git a/Documentation/git-imap-send.txt b/Documentation/git-imap-send.txt index 57db955bd4..ad446b0e8b 100644 --- a/Documentation/git-imap-send.txt +++ b/Documentation/git-imap-send.txt @@ -16,7 +16,9 @@ DESCRIPTION This command uploads a mailbox generated with 'git format-patch' into an IMAP drafts folder. This allows patches to be sent as other email is when using mail clients that cannot read mailbox -files directly. +files directly. The command also works with any general mailbox +in which emails have the fields "From", "Date", and "Subject" in +that order. Typical usage is something like: @@ -118,12 +120,6 @@ Thunderbird in particular is known to be problematic. Thunderbird users may wish to visit this web page for more information: http://kb.mozillazine.org/Plain_text_e-mail_-_Thunderbird#Completely_plain_email - -BUGS ----- -Doesn't handle lines starting with "From " in the message body. - - Author ------ Derived from isync 1.0.1 by Mike McCormack. diff --git a/Documentation/git-merge.txt b/Documentation/git-merge.txt index 9c9618cead..c2325ef90e 100644 --- a/Documentation/git-merge.txt +++ b/Documentation/git-merge.txt @@ -9,7 +9,8 @@ git-merge - Join two or more development histories together SYNOPSIS -------- [verse] -'git merge' [-n] [--stat] [--no-commit] [--squash] [-s <strategy>]... +'git merge' [-n] [--stat] [--no-commit] [--squash] + [-s <strategy>] [-X <strategy-option>] [--[no-]rerere-autoupdate] [-m <msg>] <commit>... 'git merge' <msg> HEAD <commit>... diff --git a/Documentation/git-push.txt b/Documentation/git-push.txt index 49b6bd9d92..7a4e507c4b 100644 --- a/Documentation/git-push.txt +++ b/Documentation/git-push.txt @@ -11,7 +11,7 @@ SYNOPSIS [verse] 'git push' [--all | --mirror | --tags] [-n | --dry-run] [--receive-pack=<git-receive-pack>] [--repo=<repository>] [-f | --force] [-v | --verbose] [-u | --set-upstream] - [<repository> <refspec>...] + [<repository> [<refspec>...]] DESCRIPTION ----------- diff --git a/Documentation/git-show-ref.txt b/Documentation/git-show-ref.txt index df17d49b87..3f9d9c6db3 100644 --- a/Documentation/git-show-ref.txt +++ b/Documentation/git-show-ref.txt @@ -10,7 +10,7 @@ SYNOPSIS [verse] 'git show-ref' [-q|--quiet] [--verify] [--head] [-d|--dereference] [-s|--hash[=<n>]] [--abbrev[=<n>]] [--tags] - [--heads] [--] <pattern>... + [--heads] [--] [<pattern>...] 'git show-ref' --exclude-existing[=<pattern>] < ref-list DESCRIPTION diff --git a/Documentation/git.txt b/Documentation/git.txt index 4e00b315ff..fbae9956bf 100644 --- a/Documentation/git.txt +++ b/Documentation/git.txt @@ -43,9 +43,11 @@ unreleased) version of git, that is available from 'master' branch of the `git.git` repository. Documentation for older releases are available here: -* link:v1.7.0.3/git.html[documentation for release 1.7.0.3] +* link:v1.7.0.5/git.html[documentation for release 1.7.0.5] * release notes for + link:RelNotes-1.7.0.5.txt[1.7.0.5], + link:RelNotes-1.7.0.4.txt[1.7.0.4], link:RelNotes-1.7.0.3.txt[1.7.0.3], link:RelNotes-1.7.0.2.txt[1.7.0.2], link:RelNotes-1.7.0.1.txt[1.7.0.1], diff --git a/Documentation/merge-options.txt b/Documentation/merge-options.txt index 3b83dba1a0..81ac823964 100644 --- a/Documentation/merge-options.txt +++ b/Documentation/merge-options.txt @@ -62,6 +62,11 @@ option can be used to override --squash. is used instead ('git merge-recursive' when merging a single head, 'git merge-octopus' otherwise). +-X <option>:: +--strategy-option=<option>:: + Pass merge strategy specific option through to the merge + strategy. + --summary:: --no-summary:: Synonyms to --stat and --no-stat; these are deprecated and will be @@ -74,8 +79,3 @@ option can be used to override --squash. -v:: --verbose:: Be verbose. - --X <option>:: ---strategy-option=<option>:: - Pass merge strategy specific option through to the merge - strategy. diff --git a/Documentation/technical/pack-protocol.txt b/Documentation/technical/pack-protocol.txt index 9a5cdafa9c..369f91d3b9 100644 --- a/Documentation/technical/pack-protocol.txt +++ b/Documentation/technical/pack-protocol.txt @@ -36,7 +36,7 @@ Git Transport The Git transport starts off by sending the command and repository on the wire using the pkt-line format, followed by a NUL byte and a -hostname paramater, terminated by a NUL byte. +hostname parameter, terminated by a NUL byte. 0032git-upload-pack /project.git\0host=myserver.com\0 @@ -331,7 +331,7 @@ An incremental update (fetch) response might look like this: C: 0009done\n - S: 003aACK 74730d410fcb6603ace96f1dc55ea6196122532d\n + S: 0031ACK 74730d410fcb6603ace96f1dc55ea6196122532d\n S: [PACKFILE] ---- @@ -488,7 +488,7 @@ An example client/server communication might look like this: C: 0000 C: [PACKDATA] - S: 000aunpack ok\n - S: 0014ok refs/heads/debug\n - S: 0026ng refs/heads/master non-fast-forward\n + S: 000eunpack ok\n + S: 0018ok refs/heads/debug\n + S: 002ang refs/heads/master non-fast-forward\n ---- diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN index 076c18ecc3..6705b10483 100755 --- a/GIT-VERSION-GEN +++ b/GIT-VERSION-GEN @@ -1,7 +1,7 @@ #!/bin/sh GVF=GIT-VERSION-FILE -DEF_VER=v1.7.0.3 +DEF_VER=v1.7.0.5 LF=' ' @@ -831,6 +831,7 @@ ifeq ($(uname_S),FreeBSD) NO_UINTMAX_T = YesPlease NO_STRTOUMAX = YesPlease endif + PYTHON_PATH = /usr/local/bin/python endif ifeq ($(uname_S),OpenBSD) NO_STRCASESTR = YesPlease @@ -886,6 +887,7 @@ ifeq ($(uname_S),IRIX) SNPRINTF_RETURNS_BOGUS = YesPlease SHELL_PATH = /usr/gnu/bin/bash NEEDS_LIBGEN = YesPlease + NEEDS_LIBICONV = YesPlease endif ifeq ($(uname_S),IRIX64) NO_SETENV=YesPlease @@ -904,6 +906,7 @@ ifeq ($(uname_S),IRIX64) SNPRINTF_RETURNS_BOGUS = YesPlease SHELL_PATH=/usr/gnu/bin/bash NEEDS_LIBGEN = YesPlease + NEEDS_LIBICONV = YesPlease endif ifeq ($(uname_S),HP-UX) NO_IPV6=YesPlease @@ -1 +1 @@ -Documentation/RelNotes-1.7.0.3.txt
\ No newline at end of file +Documentation/RelNotes-1.7.0.5.txt
\ No newline at end of file @@ -198,7 +198,7 @@ void create_branch(const char *head, log_all_ref_updates = 1; if (forcing) - snprintf(msg, sizeof msg, "branch: Reset from %s", + snprintf(msg, sizeof msg, "branch: Reset to %s", start_name); else if (!dont_change_ref) snprintf(msg, sizeof msg, "branch: Created from %s", diff --git a/builtin-add.c b/builtin-add.c index 2705f8d057..87d2980313 100644 --- a/builtin-add.c +++ b/builtin-add.c @@ -117,7 +117,19 @@ static void fill_pathspec_matches(const char **pathspec, char *seen, int specs) } } -static void prune_directory(struct dir_struct *dir, const char **pathspec, int prefix) +static char *find_used_pathspec(const char **pathspec) +{ + char *seen; + int i; + + for (i = 0; pathspec[i]; i++) + ; /* just counting */ + seen = xcalloc(i, 1); + fill_pathspec_matches(pathspec, seen, i); + return seen; +} + +static char *prune_directory(struct dir_struct *dir, const char **pathspec, int prefix) { char *seen; int i, specs; @@ -137,13 +149,7 @@ static void prune_directory(struct dir_struct *dir, const char **pathspec, int p } dir->nr = dst - dir->entries; fill_pathspec_matches(pathspec, seen, specs); - - for (i = 0; i < specs; i++) { - if (!seen[i] && pathspec[i][0] && !file_exists(pathspec[i])) - die("pathspec '%s' did not match any files", - pathspec[i]); - } - free(seen); + return seen; } static void treat_gitlinks(const char **pathspec) @@ -359,6 +365,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) int flags; int add_new_files; int require_pathspec; + char *seen = NULL; git_config(add_config, NULL); @@ -418,7 +425,7 @@ int cmd_add(int argc, const char **argv, const char *prefix) /* This picks up the paths that are not tracked */ baselen = fill_directory(&dir, pathspec); if (pathspec) - prune_directory(&dir, pathspec, baselen); + seen = prune_directory(&dir, pathspec, baselen); } if (refresh_only) { @@ -426,6 +433,19 @@ int cmd_add(int argc, const char **argv, const char *prefix) goto finish; } + if (pathspec) { + int i; + if (!seen) + seen = find_used_pathspec(pathspec); + for (i = 0; pathspec[i]; i++) { + if (!seen[i] && pathspec[i][0] + && !file_exists(pathspec[i])) + die("pathspec '%s' did not match any files", + pathspec[i]); + } + free(seen); + } + exit_status |= add_files_to_cache(prefix, pathspec, flags); if (add_new_files) diff --git a/builtin-apply.c b/builtin-apply.c index 7ca90472c1..771c972c55 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -2824,11 +2824,8 @@ static int check_preimage(struct patch *patch, struct cache_entry **ce, struct s if (stat_ret < 0) { struct checkout costate; /* checkout */ + memset(&costate, 0, sizeof(costate)); costate.base_dir = ""; - costate.base_dir_len = 0; - costate.force = 0; - costate.quiet = 0; - costate.not_new = 0; costate.refresh_cache = 1; if (checkout_entry(*ce, &costate, NULL) || lstat(old_name, st)) diff --git a/builtin-fast-export.c b/builtin-fast-export.c index b0a4029c94..c6dd71a7bc 100644 --- a/builtin-fast-export.c +++ b/builtin-fast-export.c @@ -503,7 +503,7 @@ static void export_marks(char *file) f = fopen(file, "w"); if (!f) - error("Unable to open marks file %s for writing.", file); + die_errno("Unable to open marks file %s for writing.", file); for (i = 0; i < idnums.size; i++) { if (deco->base && deco->base->type == 1) { diff --git a/builtin-fetch.c b/builtin-fetch.c index bbc425b655..007dabf62f 100644 --- a/builtin-fetch.c +++ b/builtin-fetch.c @@ -13,10 +13,10 @@ #include "sigchain.h" static const char * const builtin_fetch_usage[] = { - "git fetch [options] [<repository> <refspec>...]", - "git fetch [options] <group>", - "git fetch --multiple [options] [<repository> | <group>]...", - "git fetch --all [options]", + "git fetch [<options>] [<repository> [<refspec>...]]", + "git fetch [<options>] <group>", + "git fetch --multiple [<options>] [<repository> | <group>]...", + "git fetch --all [<options>]", NULL }; diff --git a/builtin-log.c b/builtin-log.c index e0d5caa61b..76962e1b08 100644 --- a/builtin-log.c +++ b/builtin-log.c @@ -1106,8 +1106,15 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix) return 0; } - if (ignore_if_in_upstream) + if (ignore_if_in_upstream) { + /* Don't say anything if head and upstream are the same. */ + if (rev.pending.nr == 2) { + struct object_array_entry *o = rev.pending.objects; + if (hashcmp(o[0].item->sha1, o[1].item->sha1) == 0) + return 0; + } get_patch_ids(&rev, &ids, prefix); + } if (!use_stdout) realstdout = xfdopen(xdup(1), "w"); diff --git a/builtin-push.c b/builtin-push.c index f7bc2b292f..9fc6931247 100644 --- a/builtin-push.c +++ b/builtin-push.c @@ -10,7 +10,7 @@ #include "parse-options.h" static const char * const push_usage[] = { - "git push [<options>] [<repository> <refspec>...]", + "git push [<options>] [<repository> [<refspec>...]]", NULL, }; diff --git a/builtin-reflog.c b/builtin-reflog.c index 64e45bd813..bd7880dc04 100644 --- a/builtin-reflog.c +++ b/builtin-reflog.c @@ -13,7 +13,7 @@ */ static const char reflog_expire_usage[] = -"git reflog (show|expire) [--verbose] [--dry-run] [--stale-fix] [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>..."; +"git reflog expire [--verbose] [--dry-run] [--stale-fix] [--expire=<time>] [--expire-unreachable=<time>] [--all] <refs>..."; static const char reflog_delete_usage[] = "git reflog delete [--verbose] [--dry-run] [--rewrite] [--updateref] <refs>..."; diff --git a/builtin-reset.c b/builtin-reset.c index 0f5022eed2..a174a31610 100644 --- a/builtin-reset.c +++ b/builtin-reset.c @@ -23,7 +23,8 @@ static const char * const git_reset_usage[] = { "git reset [--mixed | --soft | --hard | --merge] [-q] [<commit>]", - "git reset [--mixed] <commit> [--] <paths>...", + "git reset [-q] <commit> [--] <paths>...", + "git reset --patch [<commit>] [--] [<paths>...]", NULL }; diff --git a/builtin-rev-list.c b/builtin-rev-list.c index 5679170e82..1db4b4ccc6 100644 --- a/builtin-rev-list.c +++ b/builtin-rev-list.c @@ -133,9 +133,12 @@ static void show_commit(struct commit *commit, void *data) */ if (graph_show_remainder(revs->graph)) putchar('\n'); + if (revs->commit_format == CMIT_FMT_ONELINE) + putchar('\n'); } } else { - if (buf.len) + if (revs->commit_format != CMIT_FMT_USERFORMAT || + buf.len) printf("%s%c", buf.buf, info->hdr_termination); } strbuf_release(&buf); diff --git a/combine-diff.c b/combine-diff.c index 61626912e3..3480dae824 100644 --- a/combine-diff.c +++ b/combine-diff.c @@ -204,7 +204,7 @@ static void consume_line(void *state_, char *line, unsigned long len) static void combine_diff(const unsigned char *parent, unsigned int mode, mmfile_t *result_file, struct sline *sline, unsigned int cnt, int n, - int num_parent) + int num_parent, int result_deleted) { unsigned int p_lno, lno; unsigned long nmask = (1UL << n); @@ -215,7 +215,7 @@ static void combine_diff(const unsigned char *parent, unsigned int mode, struct combine_diff_state state; unsigned long sz; - if (!cnt) + if (result_deleted) return; /* result deleted */ parent_file.ptr = grab_blob(parent, mode, &sz); @@ -517,7 +517,7 @@ static void show_line_to_eol(const char *line, int len, const char *reset) } static void dump_sline(struct sline *sline, unsigned long cnt, int num_parent, - int use_color) + int use_color, int result_deleted) { unsigned long mark = (1UL<<num_parent); unsigned long no_pre_delete = (2UL<<num_parent); @@ -530,7 +530,7 @@ static void dump_sline(struct sline *sline, unsigned long cnt, int num_parent, const char *c_plain = diff_get_color(use_color, DIFF_PLAIN); const char *c_reset = diff_get_color(use_color, DIFF_RESET); - if (!cnt) + if (result_deleted) return; /* result deleted */ while (1) { @@ -687,6 +687,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent, { struct diff_options *opt = &rev->diffopt; unsigned long result_size, cnt, lno; + int result_deleted = 0; char *result, *cp; struct sline *sline; /* survived lines */ int mode_differs = 0; @@ -767,6 +768,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent, } else { deleted_file: + result_deleted = 1; result_size = 0; elem->mode = 0; result = xcalloc(1, 1); @@ -823,7 +825,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent, combine_diff(elem->parent[i].sha1, elem->parent[i].mode, &result_file, sline, - cnt, i, num_parent); + cnt, i, num_parent, result_deleted); if (elem->parent[i].mode != elem->mode) mode_differs = 1; } @@ -889,7 +891,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent, dump_quoted_path("+++ ", b_prefix, elem->path, c_meta, c_reset); dump_sline(sline, cnt, num_parent, - DIFF_OPT_TST(opt, COLOR_DIFF)); + DIFF_OPT_TST(opt, COLOR_DIFF), result_deleted); } free(result); diff --git a/compat/bswap.h b/compat/bswap.h index f3b8c44181..54756dbb05 100644 --- a/compat/bswap.h +++ b/compat/bswap.h @@ -17,6 +17,8 @@ static inline uint32_t default_swab32(uint32_t val) ((val & 0x000000ff) << 24)); } +#undef bswap32 + #if defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__)) #define bswap32(x) ({ \ diff --git a/compat/mingw.c b/compat/mingw.c index ab65f77ab9..59b18dc7ca 100644 --- a/compat/mingw.c +++ b/compat/mingw.c @@ -259,8 +259,17 @@ int mingw_utime (const char *file_name, const struct utimbuf *times) int fh, rc; /* must have write permission */ - if ((fh = open(file_name, O_RDWR | O_BINARY)) < 0) - return -1; + DWORD attrs = GetFileAttributes(file_name); + if (attrs != INVALID_FILE_ATTRIBUTES && + (attrs & FILE_ATTRIBUTE_READONLY)) { + /* ignore errors here; open() will report them */ + SetFileAttributes(file_name, attrs & ~FILE_ATTRIBUTE_READONLY); + } + + if ((fh = open(file_name, O_RDWR | O_BINARY)) < 0) { + rc = -1; + goto revert_attrs; + } time_t_to_filetime(times->modtime, &mft); time_t_to_filetime(times->actime, &aft); @@ -270,6 +279,13 @@ int mingw_utime (const char *file_name, const struct utimbuf *times) } else rc = 0; close(fh); + +revert_attrs: + if (attrs != INVALID_FILE_ATTRIBUTES && + (attrs & FILE_ATTRIBUTE_READONLY)) { + /* ignore errors again */ + SetFileAttributes(file_name, attrs); + } return rc; } diff --git a/compat/vcbuild/include/termios.h b/compat/vcbuild/include/termios.h new file mode 100644 index 0000000000..0d8552a2c6 --- /dev/null +++ b/compat/vcbuild/include/termios.h @@ -0,0 +1 @@ +/* Intentionally empty file to support building git with MSVC */ diff --git a/contrib/fast-import/import-zips.py b/contrib/fast-import/import-zips.py index 7051a83a59..82f5ed3ddc 100755 --- a/contrib/fast-import/import-zips.py +++ b/contrib/fast-import/import-zips.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python ## zip archive frontend for git-fast-import ## diff --git a/contrib/hg-to-git/hg-to-git.py b/contrib/hg-to-git/hg-to-git.py index 854cd94ba5..046cb2b268 100755 --- a/contrib/hg-to-git/hg-to-git.py +++ b/contrib/hg-to-git/hg-to-git.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#!/usr/bin/env python """ hg-to-git.py - A Mercurial to GIT converter diff --git a/contrib/p4import/git-p4import.py b/contrib/p4import/git-p4import.py index 0f3d97b67e..b6e534b65b 100644 --- a/contrib/p4import/git-p4import.py +++ b/contrib/p4import/git-p4import.py @@ -1,4 +1,4 @@ -#!/usr/bin/python +#!/usr/bin/env python # # This tool is copyright (c) 2006, Sean Estabrooks. # It is released under the Gnu Public License, version 2. @@ -590,14 +590,17 @@ static int execute(struct sockaddr *addr) static int addrcmp(const struct sockaddr_storage *s1, const struct sockaddr_storage *s2) { - if (s1->ss_family != s2->ss_family) - return s1->ss_family - s2->ss_family; - if (s1->ss_family == AF_INET) + const struct sockaddr *sa1 = (const struct sockaddr*) s1; + const struct sockaddr *sa2 = (const struct sockaddr*) s2; + + if (sa1->sa_family != sa2->sa_family) + return sa1->sa_family - sa2->sa_family; + if (sa1->sa_family == AF_INET) return memcmp(&((struct sockaddr_in *)s1)->sin_addr, &((struct sockaddr_in *)s2)->sin_addr, sizeof(struct in_addr)); #ifndef NO_IPV6 - if (s1->ss_family == AF_INET6) + if (sa1->sa_family == AF_INET6) return memcmp(&((struct sockaddr_in6 *)s1)->sin6_addr, &((struct sockaddr_in6 *)s2)->sin6_addr, sizeof(struct in6_addr)); @@ -14,6 +14,7 @@ #include "userdiff.h" #include "sigchain.h" #include "submodule.h" +#include "ll-merge.h" #ifdef NO_FAST_WORKING_DIRECTORY #define FAST_WORKING_DIRECTORY 0 @@ -1370,37 +1371,32 @@ static void free_diffstat_info(struct diffstat_t *diffstat) struct checkdiff_t { const char *filename; int lineno; + int conflict_marker_size; struct diff_options *o; unsigned ws_rule; unsigned status; }; -static int is_conflict_marker(const char *line, unsigned long len) +static int is_conflict_marker(const char *line, int marker_size, unsigned long len) { char firstchar; int cnt; - if (len < 8) + if (len < marker_size + 1) return 0; firstchar = line[0]; switch (firstchar) { - case '=': case '>': case '<': + case '=': case '>': case '<': case '|': break; default: return 0; } - for (cnt = 1; cnt < 7; cnt++) + for (cnt = 1; cnt < marker_size; cnt++) if (line[cnt] != firstchar) return 0; - /* line[0] thru line[6] are same as firstchar */ - if (firstchar == '=') { - /* divider between ours and theirs? */ - if (len != 8 || line[7] != '\n') - return 0; - } else if (len < 8 || !isspace(line[7])) { - /* not divider before ours nor after theirs */ + /* line[1] thru line[marker_size-1] are same as firstchar */ + if (len < marker_size + 1 || !isspace(line[marker_size])) return 0; - } return 1; } @@ -1408,6 +1404,7 @@ static void checkdiff_consume(void *priv, char *line, unsigned long len) { struct checkdiff_t *data = priv; int color_diff = DIFF_OPT_TST(data->o, COLOR_DIFF); + int marker_size = data->conflict_marker_size; const char *ws = diff_get_color(color_diff, DIFF_WHITESPACE); const char *reset = diff_get_color(color_diff, DIFF_RESET); const char *set = diff_get_color(color_diff, DIFF_FILE_NEW); @@ -1416,7 +1413,7 @@ static void checkdiff_consume(void *priv, char *line, unsigned long len) if (line[0] == '+') { unsigned bad; data->lineno++; - if (is_conflict_marker(line + 1, len - 1)) { + if (is_conflict_marker(line + 1, marker_size, len - 1)) { data->status |= 1; fprintf(data->o->file, "%s:%d: leftover conflict marker\n", @@ -1860,6 +1857,7 @@ static void builtin_checkdiff(const char *name_a, const char *name_b, data.lineno = 0; data.o = o; data.ws_rule = whitespace_rule(attr_path); + data.conflict_marker_size = ll_merge_marker_size(attr_path); if (fill_mmfile(&mf1, one) < 0 || fill_mmfile(&mf2, two) < 0) die("unable to read files to diff"); @@ -3865,6 +3863,7 @@ static char *run_textconv(const char *pgm, struct diff_filespec *spec, const char **arg = argv; struct child_process child; struct strbuf buf = STRBUF_INIT; + int err = 0; temp = prepare_temp_file(spec->path, spec); *arg++ = pgm; @@ -3875,16 +3874,20 @@ static char *run_textconv(const char *pgm, struct diff_filespec *spec, child.use_shell = 1; child.argv = argv; child.out = -1; - if (start_command(&child) != 0 || - strbuf_read(&buf, child.out, 0) < 0 || - finish_command(&child) != 0) { - close(child.out); - strbuf_release(&buf); + if (start_command(&child)) { remove_tempfile(); - error("error running textconv command '%s'", pgm); return NULL; } + + if (strbuf_read(&buf, child.out, 0) < 0) + err = error("error reading from textconv command '%s'", pgm); close(child.out); + + if (finish_command(&child) || err) { + strbuf_release(&buf); + remove_tempfile(); + return NULL; + } remove_tempfile(); return strbuf_detach(&buf, outsize); diff --git a/git-difftool.perl b/git-difftool.perl index d975d072db..adc42de875 100755 --- a/git-difftool.perl +++ b/git-difftool.perl @@ -78,11 +78,13 @@ sub generate_command next; } if ($arg eq '-g' || $arg eq '--gui') { - my $tool = Git::command_oneline('config', - 'diff.guitool'); - if (length($tool)) { - $ENV{GIT_DIFF_TOOL} = $tool; - } + eval { + my $tool = Git::command_oneline('config', + 'diff.guitool'); + if (length($tool)) { + $ENV{GIT_DIFF_TOOL} = $tool; + } + }; next; } if ($arg eq '-y' || $arg eq '--no-prompt') { diff --git a/git-send-email.perl b/git-send-email.perl index e05455f74c..1b99f40390 100755 --- a/git-send-email.perl +++ b/git-send-email.perl @@ -162,9 +162,12 @@ my $compose_filename; # Handle interactive edition of files. my $multiedit; -my $editor = Git::command_oneline('var', 'GIT_EDITOR'); +my $editor; sub do_edit { + if (!defined($editor)) { + $editor = Git::command_oneline('var', 'GIT_EDITOR'); + } if (defined($multiedit) && !$multiedit) { map { system('sh', '-c', $editor.' "$@"', $editor, $_); diff --git a/git-stash.sh b/git-stash.sh index aa47e541ee..59db3dc38e 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -210,14 +210,18 @@ list_stash () { } show_stash () { + have_stash || die 'No stash found' + flags=$(git rev-parse --no-revs --flags "$@") if test -z "$flags" then flags=--stat fi - w_commit=$(git rev-parse --verify --default $ref_stash "$@") && - b_commit=$(git rev-parse --verify "$w_commit^") && + w_commit=$(git rev-parse --quiet --verify --default $ref_stash "$@") && + b_commit=$(git rev-parse --quiet --verify "$w_commit^") || + die "'$*' is not a stash" + git diff $flags $b_commit $w_commit } diff --git a/git_remote_helpers/Makefile b/git_remote_helpers/Makefile index c62dfd0f4d..74b05dc91e 100644 --- a/git_remote_helpers/Makefile +++ b/git_remote_helpers/Makefile @@ -7,7 +7,11 @@ pysetupfile:=setup.py DESTDIR_SQ = $(subst ','\'',$(DESTDIR)) ifndef PYTHON_PATH - PYTHON_PATH = /usr/bin/python + ifeq ($(uname_S),FreeBSD) + PYTHON_PATH = /usr/local/bin/python + else + PYTHON_PATH = /usr/bin/python + endif endif ifndef prefix prefix = $(HOME) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 3d80deba01..9d4c58238e 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -2209,8 +2209,7 @@ sub config_to_multi { sub git_get_project_config { my ($key, $type) = @_; - # do we have project - return unless (defined $project && defined $git_dir); + return unless defined $git_dir; # key sanity check return unless ($key); diff --git a/http-backend.c b/http-backend.c index 345c12b790..d1e83d0906 100644 --- a/http-backend.c +++ b/http-backend.c @@ -538,15 +538,19 @@ static void service_rpc(char *service_name) static NORETURN void die_webcgi(const char *err, va_list params) { - char buffer[1000]; + static int dead; - http_status(500, "Internal Server Error"); - hdr_nocache(); - end_headers(); + if (!dead) { + char buffer[1000]; + dead = 1; - vsnprintf(buffer, sizeof(buffer), err, params); - fprintf(stderr, "fatal: %s\n", buffer); - exit(0); + vsnprintf(buffer, sizeof(buffer), err, params); + fprintf(stderr, "fatal: %s\n", buffer); + http_status(500, "Internal Server Error"); + hdr_nocache(); + end_headers(); + } + exit(0); /* we successfully reported a failure ;-) */ } static char* getdir(void) diff --git a/imap-send.c b/imap-send.c index 5631930bc3..379dec491f 100644 --- a/imap-send.c +++ b/imap-send.c @@ -1306,8 +1306,14 @@ static int count_messages(struct msg_data *msg) while (1) { if (!prefixcmp(p, "From ")) { + p = strstr(p+5, "\nFrom: "); + if (!p) break; + p = strstr(p+7, "\nDate: "); + if (!p) break; + p = strstr(p+7, "\nSubject: "); + if (!p) break; + p += 10; count++; - p += 5; } p = strstr(p+5, "\nFrom "); if (!p) @@ -6,6 +6,7 @@ /* ISSYMREF=01 and ISPACKED=02 are public interfaces */ #define REF_KNOWS_PEELED 04 +#define REF_BROKEN 010 struct ref_list { struct ref_list *next; @@ -275,8 +276,10 @@ static struct ref_list *get_ref_dir(const char *base, struct ref_list *list) list = get_ref_dir(ref, list); continue; } - if (!resolve_ref(ref, sha1, 1, &flag)) + if (!resolve_ref(ref, sha1, 1, &flag)) { hashclr(sha1); + flag |= REF_BROKEN; + } list = add_ref(ref, sha1, flag, list, NULL); } free(ref); @@ -539,10 +542,10 @@ static int do_one_ref(const char *base, each_ref_fn fn, int trim, { if (strncmp(base, entry->name, trim)) return 0; - /* Is this a "negative ref" that represents a deleted ref? */ - if (is_null_sha1(entry->sha1)) - return 0; + if (!(flags & DO_FOR_EACH_INCLUDE_BROKEN)) { + if (entry->flag & REF_BROKEN) + return 0; /* ignore dangling symref */ if (!has_sha1_file(entry->sha1)) { error("%s does not point to a valid object!", entry->name); return 0; diff --git a/t/t1010-mktree.sh b/t/t1010-mktree.sh index 9956e3ad62..b946f87686 100755 --- a/t/t1010-mktree.sh +++ b/t/t1010-mktree.sh @@ -58,14 +58,12 @@ test_expect_success 'allow missing object with --missing' ' test_cmp tree.missing actual ' -test_expect_failure 'mktree reads ls-tree -r output (1)' ' - git mktree <all >actual && - test_cmp tree actual +test_expect_success 'mktree refuses to read ls-tree -r output (1)' ' + test_must_fail git mktree <all >actual ' -test_expect_failure 'mktree reads ls-tree -r output (2)' ' - git mktree <all.withsub >actual && - test_cmp tree.withsub actual +test_expect_success 'mktree refuses to read ls-tree -r output (2)' ' + test_must_fail git mktree <all.withsub >actual ' test_done diff --git a/t/t2200-add-update.sh b/t/t2200-add-update.sh index 912075063b..2ad2819a34 100755 --- a/t/t2200-add-update.sh +++ b/t/t2200-add-update.sh @@ -176,4 +176,9 @@ test_expect_success 'add -u resolves unmerged paths' ' ' +test_expect_success '"add -u non-existent" should fail' ' + test_must_fail git add -u non-existent && + ! (git ls-files | grep "non-existent") +' + test_done diff --git a/t/t3700-add.sh b/t/t3700-add.sh index 85eb0fbf96..525c9a8fdf 100755 --- a/t/t3700-add.sh +++ b/t/t3700-add.sh @@ -255,4 +255,9 @@ test_expect_success 'git add to resolve conflicts on otherwise ignored path' ' git add track-this ' +test_expect_success '"add non-existent" should fail' ' + test_must_fail git add non-existent && + ! (git ls-files | grep "non-existent") +' + test_done diff --git a/t/t4014-format-patch.sh b/t/t4014-format-patch.sh index f2a2aaa2b9..843ef7f88c 100755 --- a/t/t4014-format-patch.sh +++ b/t/t4014-format-patch.sh @@ -557,4 +557,8 @@ test_expect_success 'format-patch -- <path>' ' ! grep "Use .--" error ' +test_expect_success 'format-patch --ignore-if-in-upstream HEAD' ' + git format-patch --ignore-if-in-upstream HEAD +' + test_done diff --git a/t/t4017-diff-retval.sh b/t/t4017-diff-retval.sh index 0391a5827e..61589853df 100755 --- a/t/t4017-diff-retval.sh +++ b/t/t4017-diff-retval.sh @@ -120,7 +120,6 @@ test_expect_success '--check with --no-pager returns 2 for dirty difference' ' ' - test_expect_success 'check should test not just the last line' ' echo "" >>a && git --no-pager diff --check @@ -142,4 +141,26 @@ test_expect_success 'check detects leftover conflict markers' ' git reset --hard ' +test_expect_success 'check honors conflict marker length' ' + git reset --hard && + echo ">>>>>>> boo" >>b && + echo "======" >>a && + git diff --check a && + ( + git diff --check b + test $? = 2 + ) && + git reset --hard && + echo ">>>>>>>> boo" >>b && + echo "========" >>a && + git diff --check && + echo "b conflict-marker-size=8" >.gitattributes && + ( + git diff --check b + test $? = 2 + ) && + git diff --check a && + git reset --hard +' + test_done diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh index 7584efa36b..40277c77aa 100755 --- a/t/t4038-diff-combined.sh +++ b/t/t4038-diff-combined.sh @@ -81,4 +81,12 @@ test_expect_success 'check combined output (2)' ' verify_helper sidesansone ' +test_expect_success 'diagnose truncated file' ' + >file && + git add file && + git commit --amend -C HEAD && + git show >out && + grep "diff --cc file" out +' + test_done diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index a82c5ffa1c..2692050209 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -507,15 +507,15 @@ test_expect_success 'remote prune to cause a dangling symref' ' ( cd seven && git remote prune origin - ) 2>err && + ) >err 2>&1 && grep "has become dangling" err && - : And the dangling symref will not cause other annoying errors + : And the dangling symref will not cause other annoying errors && ( cd seven && git branch -a ) 2>err && - ! grep "points nowhere" err + ! grep "points nowhere" err && ( cd seven && test_must_fail git branch nomore origin diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index b0047d3c6b..d24ca5c077 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -209,4 +209,13 @@ test_expect_success '%gd shortens ref name' ' test_cmp expect.gd-short actual.gd-short ' +test_expect_success 'oneline with empty message' ' + git commit -m "dummy" --allow-empty && + git commit -m "dummy" --allow-empty && + git filter-branch --msg-filter "sed -e s/dummy//" HEAD^^.. && + git rev-list --oneline HEAD > /tmp/test.txt && + test $(git rev-list --oneline HEAD | wc -l) -eq 5 && + test $(git rev-list --oneline --graph HEAD | wc -l) -eq 5 +' + test_done diff --git a/t/t7012-skip-worktree-writing.sh b/t/t7012-skip-worktree-writing.sh index 8d8b1c0e25..582d0b54f1 100755 --- a/t/t7012-skip-worktree-writing.sh +++ b/t/t7012-skip-worktree-writing.sh @@ -136,11 +136,11 @@ test_expect_success 'git-clean, dirty case' ' test_cmp expected result ' -test_expect_failure 'git-apply adds file' false -test_expect_failure 'git-apply updates file' false -test_expect_failure 'git-apply removes file' false -test_expect_failure 'git-mv to skip-worktree' false -test_expect_failure 'git-mv from skip-worktree' false -test_expect_failure 'git-checkout' false +#TODO test_expect_failure 'git-apply adds file' false +#TODO test_expect_failure 'git-apply updates file' false +#TODO test_expect_failure 'git-apply removes file' false +#TODO test_expect_failure 'git-mv to skip-worktree' false +#TODO test_expect_failure 'git-mv from skip-worktree' false +#TODO test_expect_failure 'git-checkout' false test_done diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh index 19c72f55bf..1de83ef98f 100755 --- a/t/t7800-difftool.sh +++ b/t/t7800-difftool.sh @@ -92,6 +92,15 @@ test_expect_success 'difftool honors --gui' ' restore_test_defaults ' +test_expect_success 'difftool --gui works without configured diff.guitool' ' + git config diff.tool test-tool && + + diff=$(git difftool --no-prompt --gui branch) && + test "$diff" = "branch" && + + restore_test_defaults +' + # Specify the diff tool using $GIT_DIFF_TOOL test_expect_success 'GIT_DIFF_TOOL variable' ' git config --unset diff.tool diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh index 356964e53a..d43f37ccaf 100755 --- a/t/t9350-fast-export.sh +++ b/t/t9350-fast-export.sh @@ -150,20 +150,22 @@ test_expect_success 'setup submodule' ' git checkout -f master && mkdir sub && - cd sub && - git init && - echo test file > file && - git add file && - git commit -m sub_initial && - cd .. && + ( + cd sub && + git init && + echo test file > file && + git add file && + git commit -m sub_initial + ) && git submodule add "`pwd`/sub" sub && git commit -m initial && test_tick && - cd sub && - echo more data >> file && - git add file && - git commit -m sub_second && - cd .. && + ( + cd sub && + echo more data >> file && + git add file && + git commit -m sub_second + ) && git add sub && git commit -m second @@ -264,19 +266,20 @@ test_expect_success 'cope with tagger-less tags' ' test_expect_success 'setup for limiting exports by PATH' ' mkdir limit-by-paths && - cd limit-by-paths && - git init && - echo hi > there && - git add there && - git commit -m "First file" && - echo foo > bar && - git add bar && - git commit -m "Second file" && - git tag -a -m msg mytag && - echo morefoo >> bar && - git add bar && - git commit -m "Change to second file" && - cd .. + ( + cd limit-by-paths && + git init && + echo hi > there && + git add there && + git commit -m "First file" && + echo foo > bar && + git add bar && + git commit -m "Second file" && + git tag -a -m msg mytag && + echo morefoo >> bar && + git add bar && + git commit -m "Change to second file" + ) ' cat > limit-by-paths/expected << EOF @@ -297,10 +300,11 @@ M 100644 :1 there EOF test_expect_success 'dropping tag of filtered out object' ' +( cd limit-by-paths && git fast-export --tag-of-filtered-object=drop mytag -- there > output && - test_cmp output expected && - cd .. + test_cmp output expected +) ' cat >> limit-by-paths/expected << EOF @@ -313,10 +317,11 @@ msg EOF test_expect_success 'rewriting tag of filtered out object' ' +( cd limit-by-paths && git fast-export --tag-of-filtered-object=rewrite mytag -- there > output && - test_cmp output expected && - cd .. + test_cmp output expected +) ' cat > limit-by-paths/expected << EOF @@ -343,13 +348,13 @@ M 100644 :2 there EOF test_expect_failure 'no exact-ref revisions included' ' - cd limit-by-paths && - git fast-export master~2..master~1 > output && - test_cmp output expected && - cd .. + ( + cd limit-by-paths && + git fast-export master~2..master~1 > output && + test_cmp output expected + ) ' - test_expect_success 'set-up a few more tags for tag export tests' ' git checkout -f master && HEAD_TREE=`git show -s --pretty=raw HEAD | grep tree | sed "s/tree //"` && |