Compare commits

..

41 Commits

Author SHA1 Message Date
87b50542a0 Git 1.7.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-18 14:55:08 -07:00
1125297ca1 Merge branch 'js/ls-files-x-doc'
* js/ls-files-x-doc:
  ls-files documentation: reword for consistency
  git-ls-files.txt: clarify -x/--exclude option

Conflicts:
	Documentation/git-ls-files.txt
2010-09-18 14:46:44 -07:00
14d872987a git-rebase--interactive.sh: replace cut with ${v%% *}
Some versions of cut do not cope well with lines that do not end in
an LF. In this case, we can completely avoid cut by using the
${var%% *} parameter expansion (suggested by Brandon Casey).

I found this problem when t3404's "avoid unnecessary reset" failed
due to the "rebase -i" not avoiding updating the tested timestamp.

On a Mac OS X 10.4.11 system:

    % printf '%s' 'foo bar' | /usr/bin/cut -d ' ' -f 1
    cut: stdin: Illegal byte sequence

Signed-off-by: Chris Johnsen <chris_johnsen@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-17 14:58:08 -07:00
84d694027f t/t7300: workaround ancient touch by rearranging arguments
The ancient touch on Solaris 7 thinks that a decimal number supplied as
the first argument specifies a date_time to give to the files specified by
the remaining arguments.  In this case, it fails to parse '1' as a proper
date_time and exits with a failure status.  Workaround this flaw by
rearranging the arguments supplied to touch so that a non-digit appears
first and touch will not be confused.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-17 14:42:13 -07:00
02567e88ee Merge branch 'bg/fix-t7003'
* bg/fix-t7003:
  t7003: Use test_commit instead of custom function
2010-09-16 07:43:41 -07:00
4c608520ed ls-files documentation: reword for consistency
Similar to descriptions of other options, state what -x does in imperative
mood.  Start sentences for -X and --exclude-per-directory options in
capital letters.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-15 17:38:50 -07:00
75609a0d44 git-ls-files.txt: clarify -x/--exclude option
Since b5227d8, -x/--exclude does not apply to cached files.
This is easy to miss unless you read the discussion in the
EXCLUDE PATTERNS section. Clarify that the option applies
to untracked files and direct the reader to EXCLUDE PATTERNS.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-15 17:30:36 -07:00
7e100effc6 Git 1.7.3 rc2 2010-09-15 12:47:37 -07:00
2e1e96126f Merge branch 'dr/maint-ls-tree-prefix-recursion-fix'
* dr/maint-ls-tree-prefix-recursion-fix:
  ls-tree $di $dir: do not mistakenly recurse into directories
2010-09-15 12:41:13 -07:00
0c61c6de34 Merge branch 'os/fix-rebase-diff-no-prefix'
* os/fix-rebase-diff-no-prefix:
  Add --src/dst-prefix to git-formt-patch in git-rebase.sh
2010-09-15 12:40:33 -07:00
e3f213c7af Merge branch 'jl/fix-test'
* jl/fix-test:
  t1020: Get rid of 'cd "$HERE"' at the start of each test
  t2016 (checkout -p): add missing &&
  t1302 (core.repositoryversion): style tweaks
  t2105 (gitfile): add missing &&
  t1450 (fsck): remove dangling objects
  tests: subshell indentation stylefix
  Several tests: cd inside subshell instead of around
2010-09-15 12:40:12 -07:00
43d268e9dd Merge branch 'ch/filter-branch-deprecate-remap-to-ancestor'
* ch/filter-branch-deprecate-remap-to-ancestor:
  filter-branch: retire --remap-to-ancestor
2010-09-15 12:39:32 -07:00
d42cb5804f Merge branch 'ch/maint-cannot-create-bundle-error'
* ch/maint-cannot-create-bundle-error:
  bundle: detect if bundle file cannot be created
2010-09-15 12:39:22 -07:00
9f0ccb5b0a Merge branch 'ks/recursive-rename-add-identical'
* ks/recursive-rename-add-identical:
  RE: [PATCH] Avoid rename/add conflict when contents are identical
2010-09-15 12:39:12 -07:00
12644fa99f Merge git://repo.or.cz/git-gui
* 'master' of git://repo.or.cz/git-gui:
  git-gui 0.13
  git-gui: avoid mis-encoding the copyright message on Windows.
  git-gui: Update Swedish translation (521t).
  git-gui: ensure correct application termination in git-gui--askpass
  git-gui: handle textconv filter on Windows and in development
  git-gui: use shell to launch textconv filter in "blame"
  git-gui: display error launching blame as a message box.
  git-gui: Make usage statement visible on Windows.
2010-09-15 12:34:48 -07:00
00e9de72c8 git-gui 0.13
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-09-14 22:42:37 +01:00
2473543caa git-gui: avoid mis-encoding the copyright message on Windows.
On Windows the tcl script file will use the system encoding and attempting
to convert the copyright mis-encodes the string. Instead, keep the message
as ASCII and substitute in the correct unicode character when running.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-09-13 20:41:42 +01:00
421a31e22d git-gui: Update Swedish translation (521t).
Signed-off-by: Peter Krefting <peter@softwolves.pp.se>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-09-13 19:25:55 +01:00
77f2e4f5f3 t7003: Use test_commit instead of custom function
t7003-filter-branch.sh had a make_commit() function that was identical
to test_commit() in test-lib.sh except that it used tr to create a
lowercase file name from the uppercase branch name instead of
appending ".t".

Not only is this unneeded code duplication, it also was something
simply waiting to fail on case-insensitive file systems.  So replace
all uses of make_commit with test_commit.

While we're editing the setup, chain it together with && so that
failures early in the sequence don't get lost and add a commit graph.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-13 10:59:06 -07:00
5879b6bbca Merge branch 'maint'
* maint:
  t3101: modernise style
  compat/nedmalloc: don't force NDEBUG on the rest of git

Conflicts:
	Makefile
2010-09-12 13:53:03 -07:00
b294ed637d ls-tree $di $dir: do not mistakenly recurse into directories
When applying two pathspecs, one of which is named as a prefix to the
other, we mistakenly recursed into the shorter one.

Noticed and fixed by David Reis.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-12 13:52:03 -07:00
e22148f406 t3101: modernise style
Also add a few " &&" cascade that were missing.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-12 13:46:58 -07:00
5418d96ddc vcs-svn: Fix some printf format compiler warnings
In particular, on systems that define uint32_t as an unsigned long,
gcc complains as follows:

      CC vcs-svn/fast_export.o
  vcs-svn/fast_export.c: In function `fast_export_modify':
  vcs-svn/fast_export.c:28: warning: unsigned int format, uint32_t arg (arg 2)
  vcs-svn/fast_export.c:28: warning: int format, uint32_t arg (arg 3)
  vcs-svn/fast_export.c: In function `fast_export_commit':
  vcs-svn/fast_export.c:42: warning: int format, uint32_t arg (arg 5)
  vcs-svn/fast_export.c:62: warning: int format, uint32_t arg (arg 2)
  vcs-svn/fast_export.c: In function `fast_export_blob':
  vcs-svn/fast_export.c:72: warning: int format, uint32_t arg (arg 2)
  vcs-svn/fast_export.c:72: warning: int format, uint32_t arg (arg 3)
      CC vcs-svn/svndump.o
  vcs-svn/svndump.c: In function `svndump_read':
  vcs-svn/svndump.c:260: warning: int format, uint32_t arg (arg 3)

In order to suppress the warnings we use the C99 format specifier
macros PRIo32 and PRIu32 from <inttypes.h>.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-12 10:24:55 -07:00
d555ff5482 compat/nedmalloc: don't force NDEBUG on the rest of git
Define the nedmalloc feature configuration macros for nedmalloc.o, only.
This keeps assert(3) working for the rest of the git source; it was
turned off for nedmalloc users before by defining NDEBUG globally.

Also remove -DUSE_NED_ALLOCATOR as this macro isn't used anywhere.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-11 10:23:03 -07:00
5b220a6876 Add --src/dst-prefix to git-formt-patch in git-rebase.sh
For the case of "diff.noprefix" in git-config, git-format-patch should
still output diff with standard prefixes for git-am

Signed-off-by: Oded Shimon <ods15@ods15.dyndns.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 17:09:44 -07:00
fd3c32c981 t1020: Get rid of 'cd "$HERE"' at the start of each test
To achieve that, all cd commands which weren't inside a subshell had to
be put into a new one.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 16:03:11 -07:00
a814615a6a t2016 (checkout -p): add missing &&
Although the set_state command is not likely to fail, it is best to
stay in the habit of checking for failures.

Cc: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 16:02:47 -07:00
8fe5aeddcb t1302 (core.repositoryversion): style tweaks
This test is from 2007, which is late enough for the style to be
recognizably modern but still a while ago.  Freshen it up to
follow new best practices:

 - guard setup commands with test_expect_setup, so errors at
   that stage can be caught;
 - use <<\EOF in preference to <<EOF, to save reviewers the
   trouble of looking for variable interpolations;
 - use test_cmp instead of test "$foo" = "$bar", for better
   output with -v on failure;
 - indent commands in subshells and let them span multiple lines;
 - combine the two "gitdir required mode" tests that do not make
   as much sense alone.

Cc: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 16:01:10 -07:00
76bbcd4382 t2105 (gitfile): add missing &&
Make sure early failures are not masked by later successes.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 15:58:45 -07:00
dbedf8bf42 t1450 (fsck): remove dangling objects
The fsck test is generally careful to remove the corrupt objects
it inserts, but dangling objects are left behind due to some typos
and omissions.  It is better to clean up more completely, to
simplify the addition of later tests.  So:

 - guard setup and cleanup with test_expect_success to catch
   typos and errors;
 - check both stdout and stderr when checking for empty fsck
   output;
 - use test_cmp empty file in place of test $(wc -l <file) = 0,
   for better debugging output when running tests with -v;
 - add a remove_object () helper and use it to replace broken
   object removal code that forgot about the fanout in
   .git/objects;
 - disable gc.auto, to avoid tripping up object removal if the
   number of objects ever reaches that threshold.
 - use test_when_finished to ensure cleanup tasks are run and
   succeed when tests fail;
 - add a new final test that no breakage or dangling objects
   was left behind.

While at it, add a brief description to test_description of the
history that is expected to persist between tests.

Part of a campaign to clean up subshell usage in tests.

Cc: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 15:58:32 -07:00
18a8269242 tests: subshell indentation stylefix
Format the subshells introduced by the previous patch (Several tests:
cd inside subshell instead of around, 2010-09-06) like so:

	(
		cd subdir &&
		...
	) &&

This is generally easier to read and has the nice side-effect that
this patch will show what commands are used in the subshell, making
it easier to check for lost environment variables and similar
behavior changes.

Cc: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-09 15:56:20 -07:00
347c47e61e Merge branch 'jl/maint-fix-test'
* jl/maint-fix-test:
  Several tests: cd inside subshell instead of around

Conflicts:
	t/t9600-cvsimport.sh
2010-09-06 16:46:36 -07:00
fd4ec4f2bb Several tests: cd inside subshell instead of around
Fixed all places where it was a straightforward change from cd'ing into a
directory and back via "cd .." to a cd inside a subshell.

Found these places with "git grep -w "cd \.\.".

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-06 14:30:53 -07:00
d5af51053c RE: [PATCH] Avoid rename/add conflict when contents are identical
>Due to this this (and maybe all the tests) need to depend on the
>SYMLINKS prereq.

Here's a third attempt with no use of symlinks in the test:

Skip the entire rename/add conflict case if the file added on the
other branch has the same contents as the file being renamed.  This
avoids giving the user an extra copy of the same file and presenting a
conflict that is confusing and pointless.

A simple test of this case has been added in
t/t3030-merge-recursive.sh.

Signed-off-by: Ken Schalk <ken.schalk@intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-09-03 11:26:49 -07:00
7ec344d802 filter-branch: retire --remap-to-ancestor
We can be clever and know by ourselves when we need the behavior
implied by "--remap-to-ancestor". No need to encumber users by having
them exposed to it as a tunable. (Option kept for backward compatibility,
but it's now a no-op.)

Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-27 16:47:01 -07:00
0f5cdf653b bundle: detect if bundle file cannot be created
bundle command silently died with no sign of failure if it
could not create the bundle file. (Eg.: its path resovles to a directory,
or the parent dir is sticky while file already exists and is owned
by someone else.)

Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-08-27 16:46:26 -07:00
aef0b48ef0 git-gui: ensure correct application termination in git-gui--askpass
With Tk 8.5 the askpass utility can hang waiting for the wish shell
implicit event loop to exit. This patch uses an explicit event loop
to ensure correct application termination.

Reported-by: Anders Kaseorg <andersk@mit.edu>
Tested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-08-18 23:19:24 +01:00
d5257fb3c1 git-gui: handle textconv filter on Windows and in development
When developing/testing we run git-gui.sh directly and the makefile
configured variables are not properly set. Configure the new shellpath
accessor to handle this case.

On Windows we may not find the shell so in this case revert to simply
executing the filter command without the shell intermediate.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-08-12 21:37:32 +01:00
62f9a632c8 git-gui: use shell to launch textconv filter in "blame"
The textconv filters may include multiple arguments and may make use
of unix shell features. To maintain compatibility with 'git blame'
ensure these commands are passed through bash.

Reported-by: Kirill Smelkov <kirr@landau.phys.spbu.ru>
Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-08-12 21:35:09 +01:00
780777720a git-gui: display error launching blame as a message box.
This does not appear to Windows users and can follow the form of the fatal
error messages near the top of the script file.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-08-08 00:07:43 +01:00
ea47503d4d git-gui: Make usage statement visible on Windows.
On Windows stdout and stderr are not connected to anything so the usage
statement is never shown to the user when an error is made with a command
line like 'git gui browser'. Use a messagebox on windows.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
2010-08-08 00:07:01 +01:00
62 changed files with 1448 additions and 1188 deletions

View File

@ -1,10 +1,11 @@
Git v1.7.3 Release Notes (draft)
================================
Git v1.7.3 Release Notes
========================
Updates since v1.7.2
--------------------
* git-gui got various updates and a new maintainer, Pat Thoyts.
* git-gui, now at version 0.13.0, got various updates and a new
maintainer, Pat Thoyts.
* Gitweb allows its configuration to change per each request; it used to
read the configuration once upon startup.
@ -63,19 +64,13 @@ release, unless otherwise noted.
* "git fetch $url" (i.e. without refspecs) was broken for quite some
time, if the current branch happen to be tracking some remote.
* "git ls-tree dir dirgarbage", when "dir" was a directory,
incorrectly recursed into "dir".
* "git note remove" created unnecessary extra commit when named object
did not have any note to begin with.
* "git rebase" did not work well if you had diff.noprefix configured.
* "git -c foo=bar subcmd" did not work well for subcmd that is not
implemented as a built-in command.
---
exec >/var/tmp/1
echo O=$(git describe master)
O=v1.7.3-rc0
git shortlog --no-merges $O..master ^maint
exit 0
What did we want to do with...
1e3d411 (Enable custom schemes for column colors in the graph API, 2010-07-13)

View File

@ -159,18 +159,7 @@ to other tags will be rewritten to point to the underlying commit.
--subdirectory-filter <directory>::
Only look at the history which touches the given subdirectory.
The result will contain that directory (and only that) as its
project root. Implies --remap-to-ancestor.
--remap-to-ancestor::
Rewrite refs to the nearest rewritten ancestor instead of
ignoring them.
+
Normally, positive refs on the command line are only changed if the
commit they point to was rewritten. However, you can limit the extent
of this rewriting by using linkgit:rev-list[1] arguments, e.g., path
limiters. Refs pointing to such excluded commits would then normally
be ignored. With this option, they are instead rewritten to point at
the nearest ancestor that was not excluded.
project root. Implies <<Remap_to_ancestor>>.
--prune-empty::
Some kind of filters will generate empty commits, that left the tree
@ -204,7 +193,18 @@ the nearest ancestor that was not excluded.
Arguments for 'git rev-list'. All positive refs included by
these options are rewritten. You may also specify options
such as '--all', but you must use '--' to separate them from
the 'git filter-branch' options.
the 'git filter-branch' options. Implies <<Remap_to_ancestor>>.
[[Remap_to_ancestor]]
Remap to ancestor
~~~~~~~~~~~~~~~~~
By using linkgit:rev-list[1] arguments, e.g., path limiters, you can limit the
set of revisions which get rewritten. However, positive refs on the command
line are distinguished: we don't let them be excluded by such limiters. For
this purpose, they are instead rewritten to point at the nearest ancestor that
was not excluded.
Examples

View File

@ -79,15 +79,16 @@ OPTIONS
-x <pattern>::
--exclude=<pattern>::
Skips files matching pattern.
Note that pattern is a shell wildcard pattern.
Skip untracked files matching pattern.
Note that pattern is a shell wildcard pattern. See EXCLUDE PATTERNS
below for more information.
-X <file>::
--exclude-from=<file>::
exclude patterns are read from <file>; 1 per line.
Read exclude patterns from <file>; 1 per line.
--exclude-per-directory=<file>::
read additional exclude patterns that apply only to the
Read additional exclude patterns that apply only to the
directory and its subdirectories in <file>.
--exclude-standard::
@ -192,7 +193,7 @@ These exclude patterns come from these places, in order:
file containing a list of patterns. Patterns are ordered
in the same order they appear in the file.
3. command line flag --exclude-per-directory=<name> specifies
3. The command line flag --exclude-per-directory=<name> specifies
a name of the file in each directory 'git ls-files'
examines, normally `.gitignore`. Files in deeper
directories take precedence. Patterns are ordered in the

View File

@ -44,6 +44,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.3/git.html[documentation for release 1.7.3]
* release notes for
link:RelNotes/1.7.3.txt[1.7.3].
* link:v1.7.2.3/git.html[documentation for release 1.7.2.3]
* release notes for

View File

@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
DEF_VER=v1.7.3-rc1
DEF_VER=v1.7.3
LF='
'

View File

@ -1465,7 +1465,7 @@ ifdef NO_REGEX
endif
ifdef USE_NED_ALLOCATOR
COMPAT_CFLAGS += -DUSE_NED_ALLOCATOR -DOVERRIDE_STRDUP -DNDEBUG -DREPLACE_SYSTEM_ALLOCATOR -Icompat/nedmalloc
COMPAT_CFLAGS += -Icompat/nedmalloc
COMPAT_OBJS += compat/nedmalloc/nedmalloc.o
endif
@ -1908,6 +1908,11 @@ ifdef NO_REGEX
compat/regex/regex.o: EXTRA_CPPFLAGS = -DGAWK -DNO_MBSUPPORT
endif
ifdef USE_NED_ALLOCATOR
compat/nedmalloc/nedmalloc.o: EXTRA_CPPFLAGS = \
-DNDEBUG -DOVERRIDE_STRDUP -DREPLACE_SYSTEM_ALLOCATOR
endif
git-%$X: %.o $(GITLIBS)
$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)

View File

@ -52,6 +52,8 @@ static int show_recursive(const char *base, int baselen, const char *pathname)
speclen = strlen(spec);
if (speclen <= len)
continue;
if (spec[len] && spec[len] != '/')
continue;
if (memcmp(pathname, spec, len))
continue;
return 1;

View File

@ -372,8 +372,10 @@ int create_bundle(struct bundle_header *header, const char *path,
close(rls.in);
if (finish_command(&rls))
return error ("pack-objects died");
if (!bundle_to_stdout)
commit_lock_file(&lock);
if (!bundle_to_stdout) {
if (commit_lock_file(&lock))
die_errno("cannot create '%s'", path);
}
return 0;
}

View File

@ -160,6 +160,10 @@ extern char *gitbasename(char *);
#define PRIx32 "x"
#endif
#ifndef PRIo32
#define PRIo32 "o"
#endif
#ifndef PATH_SEP
#define PATH_SEP ':'
#endif

View File

@ -139,6 +139,7 @@ do
continue
;;
--remap-to-ancestor)
# deprecated ($remap_to_ancestor is set now automatically)
shift
remap_to_ancestor=t
continue
@ -265,7 +266,14 @@ mkdir ../map || die "Could not create map/ directory"
# we need "--" only if there are no path arguments in $@
nonrevs=$(git rev-parse --no-revs "$@") || exit
test -z "$nonrevs" && dashdash=-- || dashdash=
if test -z "$nonrevs"
then
dashdash=--
else
dashdash=
remap_to_ancestor=t
fi
rev_args=$(git rev-parse --revs-only "$@")
case "$filter_subdir" in

View File

@ -1,7 +1,7 @@
#!/bin/sh
GVF=GIT-VERSION-FILE
DEF_VER=0.12.GITGUI
DEF_VER=0.13.GITGUI
LF='
'

View File

@ -215,6 +215,7 @@ endif
$(GITGUI_MAIN): git-gui.sh GIT-VERSION-FILE GIT-GUI-VARS
$(QUIET_GEN)rm -f $@ $@+ && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's|@@SHELL_PATH@@|$(SHELL_PATH_SQ)|' \
-e '1,30s|^ argv0=$$0| argv0=$(GITGUI_SCRIPT)|' \
-e '1,30s|^ exec wish | exec '\''$(TCLTK_PATH_SED)'\'' |' \
-e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \

View File

@ -5,6 +5,8 @@ exec wish "$0" -- "$@"
# This is a trivial implementation of an SSH_ASKPASS handler.
# Git-gui uses this script if none are already configured.
package require Tk
set answer {}
set yesno 0
set rc 255
@ -30,16 +32,20 @@ if {!$yesno} {
frame .b
button .b.ok -text OK -command finish
button .b.cancel -text Cancel -command {destroy .}
button .b.cancel -text Cancel -command cancel
pack .b.ok -side left -expand 1
pack .b.cancel -side right -expand 1
pack .b -side bottom -fill x -padx 10 -pady 10
bind . <Visibility> {focus -force .e}
bind . <Key-Return> finish
bind . <Key-Escape> {destroy .}
bind . <Destroy> {exit $rc}
bind . <Key-Return> [list .b.ok invoke]
bind . <Key-Escape> [list .b.cancel invoke]
bind . <Destroy> {set rc $rc}
proc cancel {} {
set ::rc 255
}
proc finish {} {
if {$::yesno} {
@ -50,10 +56,11 @@ proc finish {} {
}
}
set ::rc 0
puts $::answer
destroy .
set ::rc 0
}
wm title . "OpenSSH"
tk::PlaceWindow .
vwait rc
exit $rc

View File

@ -10,8 +10,8 @@
exec wish "$argv0" -- "$@"
set appvers {@@GITGUI_VERSION@@}
set copyright [encoding convertfrom utf-8 {
Copyright © 2006, 2007 Shawn Pearce, et. al.
set copyright [string map [list (c) \u00a9] {
Copyright (c) 2006-2010 Shawn Pearce, et. al.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -128,6 +128,7 @@ set _githtmldir {}
set _reponame {}
set _iscygwin {}
set _search_path {}
set _shellpath {@@SHELL_PATH@@}
set _trace [lsearch -exact $argv --trace]
if {$_trace >= 0} {
@ -137,6 +138,18 @@ if {$_trace >= 0} {
set _trace 0
}
proc shellpath {} {
global _shellpath env
if {[string match @@* $_shellpath]} {
if {[info exists env(SHELL)]} {
return $env(SHELL)
} else {
return /bin/sh
}
}
return $_shellpath
}
proc appname {} {
global _appname
return $_appname
@ -2845,7 +2858,13 @@ bind all <$M1B-Key-W> {destroy [winfo toplevel %W]}
set subcommand_args {}
proc usage {} {
puts stderr "usage: $::argv0 $::subcommand $::subcommand_args"
set s "usage: $::argv0 $::subcommand $::subcommand_args"
if {[tk windowingsystem] eq "win32"} {
wm withdraw .
tk_messageBox -icon info -title "Usage" -message $s
} else {
puts stderr $s
}
exit 1
}
@ -2938,7 +2957,12 @@ blame {
}
blame {
if {$head eq {} && ![file exists $path]} {
puts stderr [mc "fatal: cannot stat path %s: No such file or directory" $path]
catch {wm withdraw .}
tk_messageBox \
-icon error \
-type ok \
-title [mc "git-gui: fatal error"] \
-message [mc "fatal: cannot stat path %s: No such file or directory" $path]
exit 1
}
blame::new $head $path $jump_spec

View File

@ -460,7 +460,14 @@ method _load {jump} {
}
if {$commit eq {}} {
if {$do_textconv ne 0} {
set fd [open |[list $textconv $path] r]
# Run textconv with sh -c "..." to allow it to
# contain command + arguments. On windows, just
# call the filter command.
if {![file executable [shellpath]]} {
set fd [open |[linsert $textconv end $path] r]
} else {
set fd [open |[list [shellpath] -c "$textconv \"\$0\"" $path] r]
}
} else {
set fd [open $path r]
}

File diff suppressed because it is too large Load Diff

View File

@ -626,7 +626,7 @@ skip_unnecessary_picks () {
case "$fd,$command" in
3,pick|3,p)
# pick a commit whose parent is current $ONTO -> skip
sha1=$(printf '%s' "$rest" | cut -d ' ' -f 1)
sha1=${rest%% *}
case "$(git rev-parse --verify --quiet "$sha1"^)" in
"$ONTO"*)
ONTO=$sha1

View File

@ -566,6 +566,7 @@ fi
if test -z "$do_merge"
then
git format-patch -k --stdout --full-index --ignore-if-in-upstream \
--src-prefix=a/ --dst-prefix=b/ \
--no-renames $root_flag "$revisions" |
git am $git_am_opt --rebasing --resolvemsg="$RESOLVEMSG" &&
move_to_original_branch

View File

@ -955,6 +955,12 @@ static int process_renames(struct merge_options *o,
ren1->pair->two : NULL,
branch1 == o->branch1 ?
NULL : ren1->pair->two, 1);
} else if ((dst_other.mode == ren1->pair->two->mode) &&
sha_eq(dst_other.sha1, ren1->pair->two->sha1)) {
/* Added file on the other side
identical to the file being
renamed: clean merge */
update_file(o, 1, ren1->pair->two->sha1, ren1->pair->two->mode, ren1_dst);
} else if (!sha_eq(dst_other.sha1, null_sha1)) {
const char *new_path;
clean_merge = 0;

View File

@ -16,24 +16,23 @@ test_expect_success setup '
cp one original.one &&
cp dir/two original.two
'
HERE=`pwd`
LF='
'
test_expect_success 'update-index and ls-files' '
cd "$HERE" &&
git update-index --add one &&
case "`git ls-files`" in
one) echo pass one ;;
*) echo bad one; exit 1 ;;
esac &&
cd dir &&
git update-index --add two &&
case "`git ls-files`" in
two) echo pass two ;;
*) echo bad two; exit 1 ;;
esac &&
cd .. &&
(
cd dir &&
git update-index --add two &&
case "`git ls-files`" in
two) echo pass two ;;
*) echo bad two; exit 1 ;;
esac
) &&
case "`git ls-files`" in
dir/two"$LF"one) echo pass both ;;
*) echo bad; exit 1 ;;
@ -41,20 +40,20 @@ test_expect_success 'update-index and ls-files' '
'
test_expect_success 'cat-file' '
cd "$HERE" &&
two=`git ls-files -s dir/two` &&
two=`expr "$two" : "[0-7]* \\([0-9a-f]*\\)"` &&
echo "$two" &&
git cat-file -p "$two" >actual &&
cmp dir/two actual &&
cd dir &&
git cat-file -p "$two" >actual &&
cmp two actual
(
cd dir &&
git cat-file -p "$two" >actual &&
cmp two actual
)
'
rm -f actual dir/actual
test_expect_success 'diff-files' '
cd "$HERE" &&
echo a >>one &&
echo d >>dir/two &&
case "`git diff-files --name-only`" in
@ -62,77 +61,88 @@ test_expect_success 'diff-files' '
*) echo bad top; exit 1 ;;
esac &&
# diff should not omit leading paths
cd dir &&
case "`git diff-files --name-only`" in
dir/two"$LF"one) echo pass subdir ;;
*) echo bad subdir; exit 1 ;;
esac &&
case "`git diff-files --name-only .`" in
dir/two) echo pass subdir limited ;;
*) echo bad subdir limited; exit 1 ;;
esac
(
cd dir &&
case "`git diff-files --name-only`" in
dir/two"$LF"one) echo pass subdir ;;
*) echo bad subdir; exit 1 ;;
esac &&
case "`git diff-files --name-only .`" in
dir/two) echo pass subdir limited ;;
*) echo bad subdir limited; exit 1 ;;
esac
)
'
test_expect_success 'write-tree' '
cd "$HERE" &&
top=`git write-tree` &&
echo $top &&
cd dir &&
sub=`git write-tree` &&
echo $sub &&
test "z$top" = "z$sub"
(
cd dir &&
sub=`git write-tree` &&
echo $sub &&
test "z$top" = "z$sub"
)
'
test_expect_success 'checkout-index' '
cd "$HERE" &&
git checkout-index -f -u one &&
cmp one original.one &&
cd dir &&
git checkout-index -f -u two &&
cmp two ../original.two
(
cd dir &&
git checkout-index -f -u two &&
cmp two ../original.two
)
'
test_expect_success 'read-tree' '
cd "$HERE" &&
rm -f one dir/two &&
tree=`git write-tree` &&
git read-tree --reset -u "$tree" &&
cmp one original.one &&
cmp dir/two original.two &&
cd dir &&
rm -f two &&
git read-tree --reset -u "$tree" &&
cmp two ../original.two &&
cmp ../one ../original.one
(
cd dir &&
rm -f two &&
git read-tree --reset -u "$tree" &&
cmp two ../original.two &&
cmp ../one ../original.one
)
'
test_expect_success 'no file/rev ambiguity check inside .git' '
cd "$HERE" &&
git commit -a -m 1 &&
cd "$HERE"/.git &&
git show -s HEAD
(
cd .git &&
git show -s HEAD
)
'
test_expect_success 'no file/rev ambiguity check inside a bare repo' '
cd "$HERE" &&
git clone -s --bare .git foo.git &&
cd foo.git && GIT_DIR=. git show -s HEAD
(
cd foo.git &&
GIT_DIR=. git show -s HEAD
)
'
# This still does not work as it should...
: test_expect_success 'no file/rev ambiguity check inside a bare repo' '
cd "$HERE" &&
git clone -s --bare .git foo.git &&
cd foo.git && git show -s HEAD
(
cd foo.git &&
git show -s HEAD
)
'
test_expect_success SYMLINKS 'detection should not be fooled by a symlink' '
cd "$HERE" &&
rm -fr foo.git &&
git clone -s .git another &&
ln -s another yetanother &&
cd yetanother/.git &&
git show -s HEAD
(
cd yetanother/.git &&
git show -s HEAD
)
'
test_done

View File

@ -7,41 +7,64 @@ test_description='Test repository version check'
. ./test-lib.sh
cat >test.patch <<EOF
diff --git a/test.txt b/test.txt
new file mode 100644
--- /dev/null
+++ b/test.txt
@@ -0,0 +1 @@
+123
EOF
test_expect_success 'setup' '
cat >test.patch <<-\EOF &&
diff --git a/test.txt b/test.txt
new file mode 100644
--- /dev/null
+++ b/test.txt
@@ -0,0 +1 @@
+123
EOF
test_create_repo "test"
test_create_repo "test2"
GIT_CONFIG=test2/.git/config git config core.repositoryformatversion 99 || exit 1
test_create_repo "test" &&
test_create_repo "test2" &&
GIT_CONFIG=test2/.git/config git config core.repositoryformatversion 99
'
test_expect_success 'gitdir selection on normal repos' '
(test "$(git config core.repositoryformatversion)" = 0 &&
cd test &&
test "$(git config core.repositoryformatversion)" = 0)'
echo 0 >expect &&
git config core.repositoryformatversion >actual &&
(
cd test &&
git config core.repositoryformatversion >../actual2
) &&
test_cmp expect actual &&
test_cmp expect actual2
'
# Make sure it would stop at test2, not trash
test_expect_success 'gitdir selection on unsupported repo' '
(cd test2 &&
test "$(git config core.repositoryformatversion)" = 99)'
# Make sure it would stop at test2, not trash
echo 99 >expect &&
(
cd test2 &&
git config core.repositoryformatversion >../actual
)
test_cmp expect actual
'
test_expect_success 'gitdir not required mode' '
(git apply --stat test.patch &&
cd test && git apply --stat ../test.patch &&
cd ../test2 && git apply --stat ../test.patch)'
git apply --stat test.patch &&
(
cd test &&
git apply --stat ../test.patch
) &&
(
cd test2 &&
git apply --stat ../test.patch
)
'
test_expect_success 'gitdir required mode on normal repos' '
(git apply --check --index test.patch &&
cd test && git apply --check --index ../test.patch)'
test_expect_success 'gitdir required mode on unsupported repo' '
(cd test2 && test_must_fail git apply --check --index ../test.patch)
test_expect_success 'gitdir required mode' '
git apply --check --index test.patch &&
(
cd test &&
git apply --check --index ../test.patch
) &&
(
cd test2 &&
test_must_fail git apply --check --index ../test.patch
)
'
test_done

View File

@ -1,21 +1,23 @@
#!/bin/sh
test_description='git fsck random collection of tests'
test_description='git fsck random collection of tests
* (HEAD) B
* (master) A
'
. ./test-lib.sh
test_expect_success setup '
git config gc.auto 0 &&
git config i18n.commitencoding ISO-8859-1 &&
test_commit A fileA one &&
git config --unset i18n.commitencoding &&
git checkout HEAD^0 &&
test_commit B fileB two &&
git tag -d A B &&
git reflog expire --expire=now --all
'
test_expect_success 'HEAD is part of refs' '
test 0 = $(git fsck | wc -l)
git reflog expire --expire=now --all &&
>empty
'
test_expect_success 'loose objects borrowed from alternate are not missing' '
@ -25,110 +27,132 @@ test_expect_success 'loose objects borrowed from alternate are not missing' '
git init &&
echo ../../../.git/objects >.git/objects/info/alternates &&
test_commit C fileC one &&
git fsck >out &&
! grep "missing blob" out
)
git fsck >../out 2>&1
) &&
{
grep -v dangling out >actual ||
:
} &&
test_cmp empty actual
'
test_expect_success 'valid objects appear valid' '
{ git fsck 2>out; true; } &&
! grep error out &&
! grep fatal out
test_expect_success 'HEAD is part of refs, valid objects appear valid' '
git fsck >actual 2>&1 &&
test_cmp empty actual
'
# Corruption tests follow. Make sure to remove all traces of the
# specific corruption you test afterwards, lest a later test trip over
# it.
test_expect_success 'setup: helpers for corruption tests' '
sha1_file() {
echo "$*" | sed "s#..#.git/objects/&/#"
} &&
remove_object() {
file=$(sha1_file "$*") &&
test -e "$file" &&
rm -f "$file"
}
'
test_expect_success 'object with bad sha1' '
sha=$(echo blob | git hash-object -w --stdin) &&
echo $sha &&
old=$(echo $sha | sed "s+^..+&/+") &&
new=$(dirname $old)/ffffffffffffffffffffffffffffffffffffff &&
sha="$(dirname $new)$(basename $new)"
mv .git/objects/$old .git/objects/$new &&
test_when_finished "remove_object $sha" &&
git update-index --add --cacheinfo 100644 $sha foo &&
test_when_finished "git read-tree -u --reset HEAD" &&
tree=$(git write-tree) &&
test_when_finished "remove_object $tree" &&
cmt=$(echo bogus | git commit-tree $tree) &&
test_when_finished "remove_object $cmt" &&
git update-ref refs/heads/bogus $cmt &&
(git fsck 2>out; true) &&
grep "$sha.*corrupt" out &&
rm -f .git/objects/$new &&
git update-ref -d refs/heads/bogus &&
git read-tree -u --reset HEAD
test_when_finished "git update-ref -d refs/heads/bogus" &&
test_might_fail git fsck 2>out &&
cat out &&
grep "$sha.*corrupt" out
'
test_expect_success 'branch pointing to non-commit' '
git rev-parse HEAD^{tree} > .git/refs/heads/invalid &&
git rev-parse HEAD^{tree} >.git/refs/heads/invalid &&
test_when_finished "git update-ref -d refs/heads/invalid" &&
git fsck 2>out &&
grep "not a commit" out &&
git update-ref -d refs/heads/invalid
cat out &&
grep "not a commit" out
'
new=nothing
test_expect_success 'email without @ is okay' '
git cat-file commit HEAD >basis &&
sed "s/@/AT/" basis >okay &&
new=$(git hash-object -t commit -w --stdin <okay) &&
echo "$new" &&
test_when_finished "remove_object $new" &&
git update-ref refs/heads/bogus "$new" &&
test_when_finished "git update-ref -d refs/heads/bogus" &&
git fsck 2>out &&
cat out &&
! grep "error in commit $new" out
! grep "commit $new" out
'
git update-ref -d refs/heads/bogus
rm -f ".git/objects/$new"
new=nothing
test_expect_success 'email with embedded > is not okay' '
git cat-file commit HEAD >basis &&
sed "s/@[a-z]/&>/" basis >bad-email &&
new=$(git hash-object -t commit -w --stdin <bad-email) &&
echo "$new" &&
test_when_finished "remove_object $new" &&
git update-ref refs/heads/bogus "$new" &&
test_when_finished "git update-ref -d refs/heads/bogus" &&
git fsck 2>out &&
cat out &&
grep "error in commit $new" out
'
git update-ref -d refs/heads/bogus
rm -f ".git/objects/$new"
cat > invalid-tag <<EOF
object ffffffffffffffffffffffffffffffffffffffff
type commit
tag invalid
tagger T A Gger <tagger@example.com> 1234567890 -0000
This is an invalid tag.
EOF
test_expect_success 'tag pointing to nonexistent' '
tag=$(git hash-object -t tag -w --stdin < invalid-tag) &&
echo $tag > .git/refs/tags/invalid &&
cat >invalid-tag <<-\EOF
object ffffffffffffffffffffffffffffffffffffffff
type commit
tag invalid
tagger T A Gger <tagger@example.com> 1234567890 -0000
This is an invalid tag.
EOF
tag=$(git hash-object -t tag -w --stdin <invalid-tag) &&
test_when_finished "remove_object $tag" &&
echo $tag >.git/refs/tags/invalid &&
test_when_finished "git update-ref -d refs/tags/invalid" &&
test_must_fail git fsck --tags >out &&
cat out &&
grep "broken link" out &&
rm .git/refs/tags/invalid
grep "broken link" out
'
cat > wrong-tag <<EOF
object $(echo blob | git hash-object -w --stdin)
type commit
tag wrong
tagger T A Gger <tagger@example.com> 1234567890 -0000
This is an invalid tag.
EOF
test_expect_success 'tag pointing to something else than its type' '
tag=$(git hash-object -t tag -w --stdin < wrong-tag) &&
echo $tag > .git/refs/tags/wrong &&
sha=$(echo blob | git hash-object -w --stdin) &&
test_when_finished "remove_object $sha" &&
cat >wrong-tag <<-EOF &&
object $sha
type commit
tag wrong
tagger T A Gger <tagger@example.com> 1234567890 -0000
This is an invalid tag.
EOF
tag=$(git hash-object -t tag -w --stdin <wrong-tag) &&
test_when_finished "remove_object $tag" &&
echo $tag >.git/refs/tags/wrong &&
test_when_finished "git update-ref -d refs/tags/wrong" &&
test_must_fail git fsck --tags 2>out &&
cat out &&
grep "error in tag.*broken links" out &&
rm .git/refs/tags/wrong
grep "error in tag.*broken links" out
'
test_expect_success 'cleaned up' '
git fsck >actual 2>&1 &&
test_cmp empty actual
'
test_done

View File

@ -52,7 +52,7 @@ test_expect_success PERL 'git checkout -p HEAD with NO staged changes: apply' '
'
test_expect_success PERL 'git checkout -p HEAD with change already staged' '
set_state dir/foo index index
set_state dir/foo index index &&
# the third n is to get out in case it mistakenly does not apply
(echo n; echo y; echo n) | git checkout -p HEAD &&
verify_saved_state bar &&

View File

@ -63,10 +63,10 @@ cat > expected <<\EOF
EOF
test_expect_success 'update-index --update from subdir' \
'echo not so happy >file2 &&
cd dir1 &&
(cd dir1 &&
cat ../file2 >file3 &&
git update-index --again &&
cd .. &&
git update-index --again
) &&
git ls-files -s >current &&
cmp current expected'

View File

@ -13,7 +13,7 @@ test_expect_success 'submodule with absolute .git file' '
(cd sub1 &&
git init &&
REAL="$(pwd)/.real" &&
mv .git "$REAL"
mv .git "$REAL" &&
echo "gitdir: $REAL" >.git &&
test_commit first)
'

View File

@ -23,6 +23,8 @@ test_expect_success 'setup 1' '
git branch df-3 &&
git branch remove &&
git branch submod &&
git branch copy &&
git branch rename &&
echo hello >>a &&
cp a d/e &&
@ -248,6 +250,22 @@ test_expect_success 'setup 7' '
git commit -m "make d/ a submodule"
'
test_expect_success 'setup 8' '
git checkout rename &&
git mv a e &&
git add e &&
test_tick &&
git commit -m "rename a->e"
'
test_expect_success 'setup 9' '
git checkout copy &&
cp a e &&
git add e &&
test_tick &&
git commit -m "copy a->e"
'
test_expect_success 'merge-recursive simple' '
rm -fr [abcd] &&
@ -580,4 +598,21 @@ test_expect_failure 'merge-recursive simple w/submodule result' '
test_cmp expected actual
'
test_expect_success 'merge-recursive copy vs. rename' '
git checkout -f copy &&
git merge rename &&
( git ls-tree -r HEAD && git ls-files -s ) >actual &&
(
echo "100644 blob $o0 b"
echo "100644 blob $o0 c"
echo "100644 blob $o0 d/e"
echo "100644 blob $o0 e"
echo "100644 $o0 0 b"
echo "100644 $o0 0 c"
echo "100644 $o0 0 d/e"
echo "100644 $o0 0 e"
) >expected &&
test_cmp expected actual
'
test_done

View File

@ -53,17 +53,15 @@ test_expect_success setup '
git add .
'
# We have to run from a sub-directory to trigger prune_path
# Then we finally get to run our --with-tree test
cd sub
test_expect_success 'git -ls-files --with-tree should succeed from subdir' '
git ls-files --with-tree=HEAD~1 >../output
# We have to run from a sub-directory to trigger prune_path
# Then we finally get to run our --with-tree test
(
cd sub &&
git ls-files --with-tree=HEAD~1 >../output
)
'
cd ..
test_expect_success \
'git -ls-files --with-tree should add entries from named tree.' \
'test_cmp expected output'

View File

@ -165,4 +165,13 @@ test_expect_success \
EOF
test_output'
test_expect_success \
'ls-tree with one path a prefix of the other' \
'git ls-tree $tree path2/baz path2/bazbo >current &&
make_expected <<\EOF &&
040000 tree X path2/baz
120000 blob X path2/bazbo
EOF
test_output'
test_done

View File

@ -21,33 +21,32 @@ entries. Also test odd filename and missing entries handling.
'
. ./test-lib.sh
test_expect_success \
'setup' \
'echo 111 >1.txt &&
echo 222 >2.txt &&
mkdir path0 path0/a path0/a/b path0/a/b/c &&
echo 111 >path0/a/b/c/1.txt &&
mkdir path1 path1/b path1/b/c &&
echo 111 >path1/b/c/1.txt &&
mkdir path2 &&
echo 111 >path2/1.txt &&
mkdir path3 &&
echo 111 >path3/1.txt &&
echo 222 >path3/2.txt &&
find *.txt path* \( -type f -o -type l \) -print |
xargs git update-index --add &&
tree=`git write-tree` &&
echo $tree'
test_expect_success 'setup' '
echo 111 >1.txt &&
echo 222 >2.txt &&
mkdir path0 path0/a path0/a/b path0/a/b/c &&
echo 111 >path0/a/b/c/1.txt &&
mkdir path1 path1/b path1/b/c &&
echo 111 >path1/b/c/1.txt &&
mkdir path2 &&
echo 111 >path2/1.txt &&
mkdir path3 &&
echo 111 >path3/1.txt &&
echo 222 >path3/2.txt &&
find *.txt path* \( -type f -o -type l \) -print |
xargs git update-index --add &&
tree=`git write-tree` &&
echo $tree
'
test_output () {
sed -e "s/ $_x40 / X /" <current >check
test_cmp expected check
sed -e "s/ $_x40 / X /" <current >check &&
test_cmp expected check
}
test_expect_success \
'ls-tree plain' \
'git ls-tree $tree >current &&
cat >expected <<\EOF &&
test_expect_success 'ls-tree plain' '
git ls-tree $tree >current &&
cat >expected <<\EOF &&
100644 blob X 1.txt
100644 blob X 2.txt
040000 tree X path0
@ -55,13 +54,13 @@ test_expect_success \
040000 tree X path2
040000 tree X path3
EOF
test_output'
test_output
'
# Recursive does not show tree nodes anymore...
test_expect_success \
'ls-tree recursive' \
'git ls-tree -r $tree >current &&
cat >expected <<\EOF &&
test_expect_success 'ls-tree recursive' '
git ls-tree -r $tree >current &&
cat >expected <<\EOF &&
100644 blob X 1.txt
100644 blob X 2.txt
100644 blob X path0/a/b/c/1.txt
@ -70,68 +69,71 @@ test_expect_success \
100644 blob X path3/1.txt
100644 blob X path3/2.txt
EOF
test_output'
test_output
'
test_expect_success \
'ls-tree filter 1.txt' \
'git ls-tree $tree 1.txt >current &&
cat >expected <<\EOF &&
test_expect_success 'ls-tree filter 1.txt' '
git ls-tree $tree 1.txt >current &&
cat >expected <<\EOF &&
100644 blob X 1.txt
EOF
test_output'
test_output
'
test_expect_success \
'ls-tree filter path1/b/c/1.txt' \
'git ls-tree $tree path1/b/c/1.txt >current &&
cat >expected <<\EOF &&
test_expect_success 'ls-tree filter path1/b/c/1.txt' '
git ls-tree $tree path1/b/c/1.txt >current &&
cat >expected <<\EOF &&
100644 blob X path1/b/c/1.txt
EOF
test_output'
test_output
'
test_expect_success \
'ls-tree filter all 1.txt files' \
'git ls-tree $tree 1.txt path0/a/b/c/1.txt path1/b/c/1.txt path2/1.txt path3/1.txt >current &&
cat >expected <<\EOF &&
test_expect_success 'ls-tree filter all 1.txt files' '
git ls-tree $tree 1.txt path0/a/b/c/1.txt \
path1/b/c/1.txt path2/1.txt path3/1.txt >current &&
cat >expected <<\EOF &&
100644 blob X 1.txt
100644 blob X path0/a/b/c/1.txt
100644 blob X path1/b/c/1.txt
100644 blob X path2/1.txt
100644 blob X path3/1.txt
EOF
test_output'
test_output
'
# I am not so sure about this one after ls-tree doing pathspec match.
# Having both path0/a and path0/a/b/c makes path0/a redundant, and
# it behaves as if path0/a/b/c, path1/b/c, path2 and path3 are specified.
test_expect_success \
'ls-tree filter directories' \
'git ls-tree $tree path3 path2 path0/a/b/c path1/b/c path0/a >current &&
cat >expected <<\EOF &&
test_expect_success 'ls-tree filter directories' '
git ls-tree $tree path3 path2 path0/a/b/c path1/b/c path0/a >current &&
cat >expected <<\EOF &&
040000 tree X path0/a/b/c
040000 tree X path1/b/c
040000 tree X path2
040000 tree X path3
EOF
test_output'
test_output
'
# Again, duplicates are filtered away so this is equivalent to
# having 1.txt and path3
test_expect_success \
'ls-tree filter odd names' \
'git ls-tree $tree 1.txt ./1.txt .//1.txt path3/1.txt path3/./1.txt path3 path3// >current &&
cat >expected <<\EOF &&
test_expect_success 'ls-tree filter odd names' '
git ls-tree $tree 1.txt ./1.txt .//1.txt \
path3/1.txt path3/./1.txt path3 path3// >current &&
cat >expected <<\EOF &&
100644 blob X 1.txt
100644 blob X path3/1.txt
100644 blob X path3/2.txt
EOF
test_output'
test_output
'
test_expect_success \
'ls-tree filter missing files and extra slashes' \
'git ls-tree $tree 1.txt/ abc.txt path3//23.txt path3/2.txt/// >current &&
cat >expected <<\EOF &&
EOF
test_output'
test_expect_success 'ls-tree filter missing files and extra slashes' '
git ls-tree $tree 1.txt/ abc.txt \
path3//23.txt path3/2.txt/// >current &&
>expected &&
test_output
'
test_expect_success 'ls-tree filter is leading path match' '
git ls-tree $tree pa path3/a >current &&
@ -198,7 +200,7 @@ EOF
'
test_expect_success 'ls-tree --name-only' '
git ls-tree --name-only $tree >current
git ls-tree --name-only $tree >current &&
cat >expected <<\EOF &&
1.txt
2.txt
@ -211,7 +213,7 @@ EOF
'
test_expect_success 'ls-tree --name-only -r' '
git ls-tree --name-only -r $tree >current
git ls-tree --name-only -r $tree >current &&
cat >expected <<\EOF &&
1.txt
2.txt

View File

@ -42,23 +42,24 @@ test_expect_success 'setup for merge-preserving rebase' \
git commit -a -m "Modify A2" &&
git clone ./. clone1 &&
cd clone1 &&
(cd clone1 &&
git checkout -b topic origin/topic &&
git merge origin/master &&
cd .. &&
git merge origin/master
) &&
echo Fifth > B &&
git add B &&
git commit -m "Add different B" &&
git clone ./. clone2 &&
cd clone2 &&
git checkout -b topic origin/topic &&
test_must_fail git merge origin/master &&
echo Resolved > B &&
git add B &&
git commit -m "Merge origin/master into topic" &&
cd .. &&
(
cd clone2 &&
git checkout -b topic origin/topic &&
test_must_fail git merge origin/master &&
echo Resolved >B &&
git add B &&
git commit -m "Merge origin/master into topic"
) &&
git checkout topic &&
echo Fourth >> B &&

View File

@ -69,9 +69,10 @@ test_expect_success 'apply stashed changes (including index)' '
test_expect_success 'unstashing in a subdirectory' '
git reset --hard HEAD &&
mkdir subdir &&
cd subdir &&
git stash apply &&
cd ..
(
cd subdir &&
git stash apply
)
'
test_expect_success 'drop top stash' '

View File

@ -85,10 +85,11 @@ EOF
"
commit_file sm1 &&
cd sm1 &&
git reset --hard HEAD~2 >/dev/null &&
head3=$(git rev-parse --verify HEAD | cut -c1-7) &&
cd ..
head3=$(
cd sm1 &&
git reset --hard HEAD~2 >/dev/null &&
git rev-parse --verify HEAD | cut -c1-7
)
test_expect_success 'modified submodule(backward)' "
git diff-index -p --submodule=log HEAD >actual &&

View File

@ -21,27 +21,30 @@ test_expect_success setup '
test_expect_success "clone and setup child repos" '
git clone . one &&
cd one &&
echo >file updated by one &&
git commit -a -m "updated by one" &&
cd .. &&
(
cd one &&
echo >file updated by one &&
git commit -a -m "updated by one"
) &&
git clone . two &&
cd two &&
git config branch.master.remote one &&
git config remote.one.url ../one/.git/ &&
git config remote.one.fetch refs/heads/master:refs/heads/one &&
cd .. &&
(
cd two &&
git config branch.master.remote one &&
git config remote.one.url ../one/.git/ &&
git config remote.one.fetch refs/heads/master:refs/heads/one
) &&
git clone . three &&
cd three &&
git config branch.master.remote two &&
git config branch.master.merge refs/heads/one &&
mkdir -p .git/remotes &&
{
echo "URL: ../two/.git/"
echo "Pull: refs/heads/master:refs/heads/two"
echo "Pull: refs/heads/one:refs/heads/one"
} >.git/remotes/two &&
cd .. &&
(
cd three &&
git config branch.master.remote two &&
git config branch.master.merge refs/heads/one &&
mkdir -p .git/remotes &&
{
echo "URL: ../two/.git/"
echo "Pull: refs/heads/master:refs/heads/two"
echo "Pull: refs/heads/one:refs/heads/one"
} >.git/remotes/two
) &&
git clone . bundle &&
git clone . seven
'

View File

@ -30,6 +30,13 @@ test_expect_success 'tags can be excluded by rev-list options' '
'
test_expect_success 'die if bundle file cannot be created' '
mkdir adir &&
test_must_fail git bundle create adir --all
'
test_expect_failure 'bundle --stdin' '
echo master | git bundle create stdin-bundle.bdl --stdin &&

View File

@ -104,17 +104,18 @@ test_expect_success '"git fsck" works' '
test_expect_success 'repack, clone and fetch work' '
git repack -a -d &&
git clone --no-hardlinks . clone_dir &&
cd clone_dir &&
git show HEAD~5 | grep "A U Thor" &&
git show $HASH2 | grep "A U Thor" &&
git cat-file commit $R &&
git repack -a -d &&
test_must_fail git cat-file commit $R &&
git fetch ../ "refs/replace/*:refs/replace/*" &&
git show HEAD~5 | grep "O Thor" &&
git show $HASH2 | grep "O Thor" &&
git cat-file commit $R &&
cd ..
(
cd clone_dir &&
git show HEAD~5 | grep "A U Thor" &&
git show $HASH2 | grep "A U Thor" &&
git cat-file commit $R &&
git repack -a -d &&
test_must_fail git cat-file commit $R &&
git fetch ../ "refs/replace/*:refs/replace/*" &&
git show HEAD~5 | grep "O Thor" &&
git show $HASH2 | grep "O Thor" &&
git cat-file commit $R
)
'
test_expect_success '"git replace" listing and deleting' '
@ -177,10 +178,11 @@ test_expect_success 'create parallel branch without the bug' '
test_expect_success 'push to cloned repo' '
git push cloned $HASH6^:refs/heads/parallel &&
cd clone_dir &&
git checkout parallel &&
git log --pretty=oneline | grep $PARA2 &&
cd ..
(
cd clone_dir &&
git checkout parallel &&
git log --pretty=oneline | grep $PARA2
)
'
test_expect_success 'push branch with replacement' '
@ -191,20 +193,22 @@ test_expect_success 'push branch with replacement' '
git show $HASH6~2 | grep "O Thor" &&
git show $PARA3 | grep "O Thor" &&
git push cloned $HASH6^:refs/heads/parallel2 &&
cd clone_dir &&
git checkout parallel2 &&
git log --pretty=oneline | grep $PARA3 &&
git show $PARA3 | grep "A U Thor" &&
cd ..
(
cd clone_dir &&
git checkout parallel2 &&
git log --pretty=oneline | grep $PARA3 &&
git show $PARA3 | grep "A U Thor"
)
'
test_expect_success 'fetch branch with replacement' '
git branch tofetch $HASH6 &&
cd clone_dir &&
git fetch origin refs/heads/tofetch:refs/heads/parallel3
git log --pretty=oneline parallel3 | grep $PARA3
git show $PARA3 | grep "A U Thor"
cd ..
(
cd clone_dir &&
git fetch origin refs/heads/tofetch:refs/heads/parallel3
git log --pretty=oneline parallel3 | grep $PARA3
git show $PARA3 | grep "A U Thor"
)
'
test_expect_success 'bisect and replacements' '

View File

@ -3,31 +3,34 @@
test_description='git filter-branch'
. ./test-lib.sh
make_commit () {
lower=$(echo $1 | tr '[A-Z]' '[a-z]')
echo $lower > $lower
git add $lower
test_tick
git commit -m $1
git tag $1
}
test_expect_success 'setup' '
make_commit A
make_commit B
git checkout -b branch B
make_commit D
mkdir dir
make_commit dir/D
make_commit E
git checkout master
make_commit C
git checkout branch
git merge C
git tag F
make_commit G
make_commit H
test_commit A &&
test_commit B &&
git checkout -b branch B &&
test_commit D &&
mkdir dir &&
test_commit dir/D &&
test_commit E &&
git checkout master &&
test_commit C &&
git checkout branch &&
git merge C &&
git tag F &&
test_commit G &&
test_commit H
'
# * (HEAD, branch) H
# * G
# * Merge commit 'C' into branch
# |\
# | * (master) C
# * | E
# * | dir/D
# * | D
# |/
# * B
# * A
H=$(git rev-parse H)
@ -65,14 +68,14 @@ test_expect_success 'Fail if commit filter fails' '
'
test_expect_success 'rewrite, renaming a specific file' '
git filter-branch -f --tree-filter "mv d doh || :" HEAD
git filter-branch -f --tree-filter "mv D.t doh || :" HEAD
'
test_expect_success 'test that the file was renamed' '
test d = "$(git show HEAD:doh --)" &&
! test -f d &&
test D = "$(git show HEAD:doh --)" &&
! test -f D.t &&
test -f doh &&
test d = "$(cat doh)"
test D = "$(cat doh)"
'
test_expect_success 'rewrite, renaming a specific directory' '
@ -80,18 +83,18 @@ test_expect_success 'rewrite, renaming a specific directory' '
'
test_expect_success 'test that the directory was renamed' '
test dir/d = "$(git show HEAD:diroh/d --)" &&
test dir/D = "$(git show HEAD:diroh/D.t --)" &&
! test -d dir &&
test -d diroh &&
! test -d diroh/dir &&
test -f diroh/d &&
test dir/d = "$(cat diroh/d)"
test -f diroh/D.t &&
test dir/D = "$(cat diroh/D.t)"
'
git tag oldD HEAD~4
test_expect_success 'rewrite one branch, keeping a side branch' '
git branch modD oldD &&
git filter-branch -f --tree-filter "mv b boh || :" D..modD
git filter-branch -f --tree-filter "mv B.t boh || :" D..modD
'
test_expect_success 'common ancestor is still common (unchanged)' '
@ -104,13 +107,13 @@ test_expect_success 'filter subdirectory only' '
git add subdir/new &&
test_tick &&
git commit -m "subdir" &&
echo H > a &&
echo H > A.t &&
test_tick &&
git commit -m "not subdir" a &&
git commit -m "not subdir" A.t &&
echo A > subdir/new &&
test_tick &&
git commit -m "again subdir" subdir/new &&
git rm a &&
git rm A.t &&
test_tick &&
git commit -m "again not subdir" &&
git branch sub &&
@ -134,7 +137,7 @@ test_expect_success 'more setup' '
git add subdir/new &&
test_tick &&
git commit -m "subdir on master" subdir/new &&
git rm a &&
git rm A.t &&
test_tick &&
git commit -m "again subdir on master" &&
git merge branch
@ -283,8 +286,8 @@ test_expect_success 'Tag name filtering allows slashes in tag names' '
test_expect_success 'Prune empty commits' '
git rev-list HEAD > expect &&
make_commit to_remove &&
git filter-branch -f --index-filter "git update-index --remove to_remove" --prune-empty HEAD &&
test_commit to_remove &&
git filter-branch -f --index-filter "git update-index --remove to_remove.t" --prune-empty HEAD &&
git rev-list HEAD > actual &&
test_cmp expect actual
'
@ -307,6 +310,24 @@ test_expect_success '--remap-to-ancestor with filename filters' '
test $orig_invariant = $(git rev-parse invariant)
'
test_expect_success 'automatic remapping to ancestor with filename filters' '
git checkout master &&
git reset --hard A &&
test_commit add-foo2 foo 1 &&
git branch moved-foo2 &&
test_commit add-bar2 bar a &&
git branch invariant2 &&
orig_invariant=$(git rev-parse invariant2) &&
git branch moved-bar2 &&
test_commit change-foo2 foo 2 &&
git filter-branch -f \
moved-foo2 moved-bar2 A..master \
-- -- foo &&
test $(git rev-parse moved-foo2) = $(git rev-parse moved-bar2) &&
test $(git rev-parse moved-foo2) = $(git rev-parse master^) &&
test $orig_invariant = $(git rev-parse invariant2)
'
test_expect_success 'setup submodule' '
rm -fr ?* .git &&
git init &&

View File

@ -443,7 +443,7 @@ test_expect_success 'git clean -e' '
(
cd repo &&
git init &&
touch 1 2 3 known &&
touch known 1 2 3 &&
git add known &&
git clean -f -e 1 -e 2 &&
test -e 1 &&

View File

@ -413,12 +413,13 @@ test_expect_success 'submodule <invalid-path> warns' '
test_expect_success 'add submodules without specifying an explicit path' '
mkdir repo &&
cd repo &&
git init &&
echo r >r &&
git add r &&
git commit -m "repo commit 1" &&
cd .. &&
(
cd repo &&
git init &&
echo r >r &&
git add r &&
git commit -m "repo commit 1"
) &&
git clone --bare repo/ bare.git &&
cd addtest &&
git submodule add "$submodurl/repo" &&

View File

@ -66,10 +66,11 @@ EOF
"
commit_file sm1 &&
cd sm1 &&
git reset --hard HEAD~2 >/dev/null &&
head3=$(git rev-parse --verify HEAD | cut -c1-7) &&
cd ..
head3=$(
cd sm1 &&
git reset --hard HEAD~2 >/dev/null &&
git rev-parse --verify HEAD | cut -c1-7
)
test_expect_success 'modified submodule(backward)' "
git submodule summary >actual &&

View File

@ -22,17 +22,18 @@ esac
test_expect_success \
'initialize git svn' '
mkdir import &&
cd import &&
echo foo > foo &&
ln -s foo foo.link
mkdir -p dir/a/b/c/d/e &&
echo "deep dir" > dir/a/b/c/d/e/file &&
mkdir bar &&
echo "zzz" > bar/zzz &&
echo "#!/bin/sh" > exec.sh &&
chmod +x exec.sh &&
svn_cmd import -m "import for git svn" . "$svnrepo" >/dev/null &&
cd .. &&
(
cd import &&
echo foo >foo &&
ln -s foo foo.link
mkdir -p dir/a/b/c/d/e &&
echo "deep dir" >dir/a/b/c/d/e/file &&
mkdir bar &&
echo "zzz" >bar/zzz &&
echo "#!/bin/sh" >exec.sh &&
chmod +x exec.sh &&
svn_cmd import -m "import for git svn" . "$svnrepo" >/dev/null
) &&
rm -rf import &&
git svn init "$svnrepo"'

View File

@ -53,8 +53,9 @@ cd ..
rm -rf import
test_expect_success 'checkout working copy from svn' 'svn co "$svnrepo" test_wc'
test_expect_success 'setup some commits to svn' \
'cd test_wc &&
test_expect_success 'setup some commits to svn' '
(
cd test_wc &&
echo Greetings >> kw.c &&
poke kw.c &&
svn_cmd commit -m "Not yet an Id" &&
@ -63,8 +64,9 @@ test_expect_success 'setup some commits to svn' \
svn_cmd commit -m "Modified file, but still not yet an Id" &&
svn_cmd propset svn:keywords Id kw.c &&
poke kw.c &&
svn_cmd commit -m "Propset Id" &&
cd ..'
svn_cmd commit -m "Propset Id"
)
'
test_expect_success 'initialize git svn' 'git svn init "$svnrepo"'
test_expect_success 'fetch revisions from svn' 'git svn fetch'
@ -81,13 +83,15 @@ expect='/* $Id$ */'
got="`sed -ne 2p kw.c`"
test_expect_success 'raw $Id$ found in kw.c' "test '$expect' = '$got'"
test_expect_success "propset CR on crlf files" \
'cd test_wc &&
test_expect_success "propset CR on crlf files" '
(
cd test_wc &&
svn_cmd propset svn:eol-style CR empty &&
svn_cmd propset svn:eol-style CR crlf &&
svn_cmd propset svn:eol-style CR ne_crlf &&
svn_cmd commit -m "propset CR on crlf files" &&
cd ..'
svn_cmd commit -m "propset CR on crlf files"
)
'
test_expect_success 'fetch and pull latest from svn and checkout a new wc' \
'git svn fetch &&
@ -137,19 +141,20 @@ cat > show-ignore.expect <<\EOF
EOF
test_expect_success 'test show-ignore' "
cd test_wc &&
mkdir -p deeply/nested/directory &&
touch deeply/nested/directory/.keep &&
svn_cmd add deeply &&
svn_cmd up &&
svn_cmd propset -R svn:ignore '
(
cd test_wc &&
mkdir -p deeply/nested/directory &&
touch deeply/nested/directory/.keep &&
svn_cmd add deeply &&
svn_cmd up &&
svn_cmd propset -R svn:ignore '
no-such-file*
' .
svn_cmd commit -m 'propset svn:ignore'
cd .. &&
svn_cmd commit -m 'propset svn:ignore'
) &&
git svn show-ignore > show-ignore.got &&
cmp show-ignore.expect show-ignore.got
"
"
cat >create-ignore.expect <<\EOF
/no-such-file*

View File

@ -4,13 +4,14 @@ test_description='git svn rmdir'
test_expect_success 'initialize repo' '
mkdir import &&
cd import &&
mkdir -p deeply/nested/directory/number/1 &&
mkdir -p deeply/nested/directory/number/2 &&
echo foo > deeply/nested/directory/number/1/file &&
echo foo > deeply/nested/directory/number/2/another &&
svn_cmd import -m "import for git svn" . "$svnrepo" &&
cd ..
(
cd import &&
mkdir -p deeply/nested/directory/number/1 &&
mkdir -p deeply/nested/directory/number/2 &&
echo foo >deeply/nested/directory/number/1/file &&
echo foo >deeply/nested/directory/number/2/another &&
svn_cmd import -m "import for git svn" . "$svnrepo"
)
'
test_expect_success 'mirror via git svn' '

View File

@ -8,22 +8,24 @@ test_description='git svn fetching'
test_expect_success 'initialize repo' '
mkdir import &&
cd import &&
mkdir -p trunk &&
echo hello > trunk/readme &&
svn_cmd import -m "initial" . "$svnrepo" &&
cd .. &&
(
cd import &&
mkdir -p trunk &&
echo hello >trunk/readme &&
svn_cmd import -m "initial" . "$svnrepo"
) &&
svn_cmd co "$svnrepo" wc &&
cd wc &&
echo world >> trunk/readme &&
poke trunk/readme &&
svn_cmd commit -m "another commit" &&
svn_cmd up &&
svn_cmd mv trunk thunk &&
echo goodbye >> thunk/readme &&
poke thunk/readme &&
svn_cmd commit -m "bye now" &&
cd ..
(
cd wc &&
echo world >>trunk/readme &&
poke trunk/readme &&
svn_cmd commit -m "another commit" &&
svn_cmd up &&
svn_cmd mv trunk thunk &&
echo goodbye >>thunk/readme &&
poke thunk/readme &&
svn_cmd commit -m "bye now"
)
'
test_expect_success 'init and fetch a moved directory' '
@ -83,16 +85,17 @@ test_expect_success 'follow larger parent' '
'
test_expect_success 'follow higher-level parent' '
svn mkdir -m "follow higher-level parent" "$svnrepo"/blob &&
svn co "$svnrepo"/blob blob &&
cd blob &&
echo hi > hi &&
svn add hi &&
svn commit -m "hihi" &&
cd ..
svn mkdir -m "new glob at top level" "$svnrepo"/glob &&
svn mv -m "move blob down a level" "$svnrepo"/blob "$svnrepo"/glob/blob &&
git svn init --minimize-url -i blob "$svnrepo"/glob/blob &&
svn mkdir -m "follow higher-level parent" "$svnrepo"/blob &&
svn co "$svnrepo"/blob blob &&
(
cd blob &&
echo hi > hi &&
svn add hi &&
svn commit -m "hihi"
) &&
svn mkdir -m "new glob at top level" "$svnrepo"/glob &&
svn mv -m "move blob down a level" "$svnrepo"/blob "$svnrepo"/glob/blob &&
git svn init --minimize-url -i blob "$svnrepo"/glob/blob &&
git svn fetch -i blob
'
@ -117,18 +120,23 @@ test_expect_success 'follow-parent avoids deleting relevant info' '
import/trunk/subversion/bindings/swig/perl/t/larger-parent &&
echo "bad delete test 2" > \
import/trunk/subversion/bindings/swig/perl/another-larger &&
cd import &&
svn import -m "r9270 test" . "$svnrepo"/r9270 &&
cd .. &&
(
cd import &&
svn import -m "r9270 test" . "$svnrepo"/r9270
) &&
svn_cmd co "$svnrepo"/r9270/trunk/subversion/bindings/swig/perl r9270 &&
cd r9270 &&
svn mkdir native &&
svn mv t native/t &&
for i in a b c; do svn mv $i.pm native/$i.pm; done &&
echo z >> native/t/c.t &&
poke native/t/c.t &&
svn commit -m "reorg test" &&
cd .. &&
(
cd r9270 &&
svn mkdir native &&
svn mv t native/t &&
for i in a b c
do
svn mv $i.pm native/$i.pm
done &&
echo z >>native/t/c.t &&
poke native/t/c.t &&
svn commit -m "reorg test"
) &&
git svn init --minimize-url -i r9270-t \
"$svnrepo"/r9270/trunk/subversion/bindings/swig/perl/native/t &&
git svn fetch -i r9270-t &&

View File

@ -6,10 +6,11 @@ test_description='git svn commit-diff'
test_expect_success 'initialize repo' '
mkdir import &&
cd import &&
echo hello > readme &&
svn_cmd import -m "initial" . "$svnrepo" &&
cd .. &&
(
cd import &&
echo hello >readme &&
svn_cmd import -m "initial" . "$svnrepo"
) &&
echo hello > readme &&
git update-index --add readme &&
git commit -a -m "initial" &&

View File

@ -6,21 +6,23 @@ test_description='git svn commit-diff clobber'
test_expect_success 'initialize repo' '
mkdir import &&
cd import &&
echo initial > file &&
svn_cmd import -m "initial" . "$svnrepo" &&
cd .. &&
(
cd import &&
echo initial >file &&
svn_cmd import -m "initial" . "$svnrepo"
) &&
echo initial > file &&
git update-index --add file &&
git commit -a -m "initial"
'
test_expect_success 'commit change from svn side' '
svn_cmd co "$svnrepo" t.svn &&
cd t.svn &&
echo second line from svn >> file &&
poke file &&
svn_cmd commit -m "second line from svn" &&
cd .. &&
(
cd t.svn &&
echo second line from svn >>file &&
poke file &&
svn_cmd commit -m "second line from svn"
) &&
rm -rf t.svn
'
@ -44,11 +46,12 @@ test_expect_success 'dcommit fails to commit because of conflict' '
git svn fetch &&
git reset --hard refs/${remotes_git_svn} &&
svn_cmd co "$svnrepo" t.svn &&
cd t.svn &&
echo fourth line from svn >> file &&
poke file &&
svn_cmd commit -m "fourth line from svn" &&
cd .. &&
(
cd t.svn &&
echo fourth line from svn >>file &&
poke file &&
svn_cmd commit -m "fourth line from svn"
) &&
rm -rf t.svn &&
echo "fourth line from git" >> file &&
git commit -a -m "fourth line from git" &&
@ -68,11 +71,12 @@ test_expect_success 'dcommit does the svn equivalent of an index merge' "
test_expect_success 'commit another change from svn side' '
svn_cmd co "$svnrepo" t.svn &&
cd t.svn &&
echo third line from svn >> file &&
(
cd t.svn &&
echo third line from svn >>file &&
poke file &&
svn_cmd commit -m "third line from svn" &&
cd .. &&
svn_cmd commit -m "third line from svn"
) &&
rm -rf t.svn
'

View File

@ -6,14 +6,16 @@ test_description='git svn metadata migrations from previous versions'
test_expect_success 'setup old-looking metadata' '
cp "$GIT_DIR"/config "$GIT_DIR"/config-old-git-svn &&
mkdir import &&
cd import &&
for i in trunk branches/a branches/b \
tags/0.1 tags/0.2 tags/0.3; do
mkdir -p $i && \
echo hello >> $i/README || exit 1
done && \
(
cd import &&
for i in trunk branches/a branches/b tags/0.1 tags/0.2 tags/0.3
do
mkdir -p $i &&
echo hello >>$i/README ||
exit 1
done &&
svn_cmd import -m test . "$svnrepo"
cd .. &&
) &&
git svn init "$svnrepo" &&
git svn fetch &&
rm -rf "$GIT_DIR"/svn &&

View File

@ -37,11 +37,12 @@ EOF
test_expect_success 'setup svn repository' '
svn_cmd co "$svnrepo" mysvnwork &&
mkdir -p mysvnwork/trunk &&
cd mysvnwork &&
big_text_block >> trunk/README &&
(
cd mysvnwork &&
big_text_block >>trunk/README &&
svn_cmd add trunk &&
svn_cmd ci -m "first commit" trunk &&
cd ..
svn_cmd ci -m "first commit" trunk
)
'
test_expect_success 'setup git mirror and merge' '

View File

@ -61,11 +61,12 @@ test_expect_success 'add a file with plus signs' '
test_expect_success 'clone the repository to test rebase' '
git svn clone "$svnrepo" test-rebase &&
cd test-rebase &&
echo test-rebase > test-rebase &&
(
cd test-rebase &&
echo test-rebase >test-rebase &&
git add test-rebase &&
git commit -m test-rebase &&
cd ..
git commit -m test-rebase
)
'
test_expect_success 'make a commit to test rebase' '

View File

@ -8,14 +8,16 @@ test_description='git svn log tests'
test_expect_success 'setup repository and import' '
mkdir import &&
cd import &&
for i in trunk branches/a branches/b \
tags/0.1 tags/0.2 tags/0.3; do
mkdir -p $i && \
echo hello >> $i/README || exit 1
done && \
(
cd import &&
for i in trunk branches/a branches/b tags/0.1 tags/0.2 tags/0.3
do
mkdir -p $i &&
echo hello >>$i/README ||
exit 1
done &&
svn_cmd import -m test . "$svnrepo"
cd .. &&
) &&
git svn init "$svnrepo" -T trunk -b branches -t tags &&
git svn fetch &&
git reset --hard trunk &&

View File

@ -39,27 +39,30 @@ quoted_svnrepo="$(echo $svnrepo | sed 's/ /%20/')"
test_expect_success 'setup repository and import' '
mkdir info &&
cd info &&
echo FIRST > A &&
echo one > file &&
(
cd info &&
echo FIRST >A &&
echo one >file &&
ln -s file symlink-file &&
mkdir directory &&
touch directory/.placeholder &&
ln -s directory symlink-directory &&
svn_cmd import -m "initial" . "$svnrepo" &&
cd .. &&
svn_cmd import -m "initial" . "$svnrepo"
) &&
svn_cmd co "$svnrepo" svnwc &&
cd svnwc &&
echo foo > foo &&
(
cd svnwc &&
echo foo >foo &&
svn_cmd add foo &&
svn_cmd commit -m "change outside directory" &&
svn_cmd update &&
cd .. &&
svn_cmd update
) &&
mkdir gitwc &&
cd gitwc &&
(
cd gitwc &&
git svn init "$svnrepo" &&
git svn fetch &&
cd .. &&
git svn fetch
) &&
ptouch gitwc/file svnwc/file &&
ptouch gitwc/directory svnwc/directory &&
ptouch gitwc/symlink-file svnwc/symlink-file &&
@ -138,14 +141,16 @@ test_expect_success 'info --url symlink-directory' '
test_expect_success 'info added-file' "
echo two > gitwc/added-file &&
cd gitwc &&
git add added-file &&
cd .. &&
(
cd gitwc &&
git add added-file
) &&
cp gitwc/added-file svnwc/added-file &&
ptouch gitwc/added-file svnwc/added-file &&
cd svnwc &&
svn_cmd add added-file > /dev/null &&
cd .. &&
(
cd svnwc &&
svn_cmd add added-file > /dev/null
) &&
(cd svnwc; svn info added-file) > expected.info-added-file &&
(cd gitwc; git svn info added-file) > actual.info-added-file &&
test_cmp expected.info-added-file actual.info-added-file
@ -160,12 +165,14 @@ test_expect_success 'info added-directory' "
mkdir gitwc/added-directory svnwc/added-directory &&
ptouch gitwc/added-directory svnwc/added-directory &&
touch gitwc/added-directory/.placeholder &&
cd svnwc &&
svn_cmd add added-directory > /dev/null &&
cd .. &&
cd gitwc &&
git add added-directory &&
cd .. &&
(
cd svnwc &&
svn_cmd add added-directory > /dev/null
) &&
(
cd gitwc &&
git add added-directory
) &&
(cd svnwc; svn info added-directory) \
> expected.info-added-directory &&
(cd gitwc; git svn info added-directory) \
@ -179,14 +186,16 @@ test_expect_success 'info --url added-directory' '
'
test_expect_success 'info added-symlink-file' "
cd gitwc &&
(
cd gitwc &&
ln -s added-file added-symlink-file &&
git add added-symlink-file &&
cd .. &&
cd svnwc &&
git add added-symlink-file
) &&
(
cd svnwc &&
ln -s added-file added-symlink-file &&
svn_cmd add added-symlink-file > /dev/null &&
cd .. &&
svn_cmd add added-symlink-file > /dev/null
) &&
ptouch gitwc/added-symlink-file svnwc/added-symlink-file &&
(cd svnwc; svn info added-symlink-file) \
> expected.info-added-symlink-file &&
@ -202,14 +211,16 @@ test_expect_success 'info --url added-symlink-file' '
'
test_expect_success 'info added-symlink-directory' "
cd gitwc &&
(
cd gitwc &&
ln -s added-directory added-symlink-directory &&
git add added-symlink-directory &&
cd .. &&
cd svnwc &&
git add added-symlink-directory
) &&
(
cd svnwc &&
ln -s added-directory added-symlink-directory &&
svn_cmd add added-symlink-directory > /dev/null &&
cd .. &&
svn_cmd add added-symlink-directory > /dev/null
) &&
ptouch gitwc/added-symlink-directory svnwc/added-symlink-directory &&
(cd svnwc; svn info added-symlink-directory) \
> expected.info-added-symlink-directory &&
@ -230,12 +241,14 @@ test_expect_success 'info --url added-symlink-directory' '
# simply reuses the Last Changed Date.
test_expect_success 'info deleted-file' "
cd gitwc &&
git rm -f file > /dev/null &&
cd .. &&
cd svnwc &&
svn_cmd rm --force file > /dev/null &&
cd .. &&
(
cd gitwc &&
git rm -f file > /dev/null
) &&
(
cd svnwc &&
svn_cmd rm --force file > /dev/null
) &&
(cd svnwc; svn info file) |
sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \
> expected.info-deleted-file &&
@ -251,12 +264,14 @@ test_expect_success 'info --url file (deleted)' '
'
test_expect_success 'info deleted-directory' "
cd gitwc &&
git rm -r -f directory > /dev/null &&
cd .. &&
cd svnwc &&
svn_cmd rm --force directory > /dev/null &&
cd .. &&
(
cd gitwc &&
git rm -r -f directory > /dev/null
) &&
(
cd svnwc &&
svn_cmd rm --force directory > /dev/null
) &&
(cd svnwc; svn info directory) |
sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \
> expected.info-deleted-directory &&
@ -272,12 +287,14 @@ test_expect_success 'info --url directory (deleted)' '
'
test_expect_success 'info deleted-symlink-file' "
cd gitwc &&
git rm -f symlink-file > /dev/null &&
cd .. &&
cd svnwc &&
svn_cmd rm --force symlink-file > /dev/null &&
cd .. &&
(
cd gitwc &&
git rm -f symlink-file > /dev/null
) &&
(
cd svnwc &&
svn_cmd rm --force symlink-file > /dev/null
) &&
(cd svnwc; svn info symlink-file) |
sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \
> expected.info-deleted-symlink-file &&
@ -294,12 +311,14 @@ test_expect_success 'info --url symlink-file (deleted)' '
'
test_expect_success 'info deleted-symlink-directory' "
cd gitwc &&
git rm -f symlink-directory > /dev/null &&
cd .. &&
cd svnwc &&
svn_cmd rm --force symlink-directory > /dev/null &&
cd .. &&
(
cd gitwc &&
git rm -f symlink-directory > /dev/null
) &&
(
cd svnwc &&
svn_cmd rm --force symlink-directory > /dev/null
) &&
(cd svnwc; svn info symlink-directory) |
sed -e 's/^\(Text Last Updated:\).*/\1 TEXT-LAST-UPDATED-STRING/' \
> expected.info-deleted-symlink-directory &&
@ -346,9 +365,10 @@ test_expect_success 'info --url unknown-directory' '
'
test_expect_success 'info unknown-symlink-file' "
cd gitwc &&
ln -s unknown-file unknown-symlink-file &&
cd .. &&
(
cd gitwc &&
ln -s unknown-file unknown-symlink-file
) &&
(cd gitwc; test_must_fail git svn info unknown-symlink-file) \
2> actual.info-unknown-symlink-file &&
grep unknown-symlink-file actual.info-unknown-symlink-file
@ -361,9 +381,10 @@ test_expect_success 'info --url unknown-symlink-file' '
'
test_expect_success 'info unknown-symlink-directory' "
cd gitwc &&
ln -s unknown-directory unknown-symlink-directory &&
cd .. &&
(
cd gitwc &&
ln -s unknown-directory unknown-symlink-directory
) &&
(cd gitwc; test_must_fail git svn info unknown-symlink-directory) \
2> actual.info-unknown-symlink-directory &&
grep unknown-symlink-directory actual.info-unknown-symlink-directory

View File

@ -20,9 +20,10 @@ test_expect_success 'setup svnrepo' '
test_expect_success 'test clone with percent escapes' '
git svn clone "$svnrepo/pr%20ject" clone &&
cd clone &&
git rev-parse refs/${remotes_git_svn} &&
cd ..
(
cd clone &&
git rev-parse refs/${remotes_git_svn}
)
'
# SVN works either way, so should we...

View File

@ -8,10 +8,10 @@ test_description='git svn respects rewriteRoot during rebuild'
. ./lib-git-svn.sh
mkdir import
cd import
(cd import
touch foo
svn_cmd import -m 'import for git svn' . "$svnrepo" >/dev/null
cd ..
)
rm -rf import
test_expect_success 'init, fetch and checkout repository' '

View File

@ -19,19 +19,19 @@ test_expect_success 'setup svnrepo' '
test_expect_success 'test clone with multi-glob in branch names' '
git svn clone -T trunk -b branches/*/* -t tags \
"$svnrepo/project" project &&
cd project &&
(cd project &&
git rev-parse "refs/remotes/v14.1/beta" &&
git rev-parse "refs/remotes/v14.1/gold" &&
cd ..
git rev-parse "refs/remotes/v14.1/gold"
)
'
test_expect_success 'test dcommit to multi-globbed branch' "
cd project &&
(cd project &&
git reset --hard 'refs/remotes/v14.1/gold' &&
echo hello >> foo &&
git commit -m 'hello' -- foo &&
git svn dcommit &&
cd ..
git svn dcommit
)
"
test_done

View File

@ -9,27 +9,27 @@ test_description='git svn partial-rebuild tests'
test_expect_success 'initialize svnrepo' '
mkdir import &&
(
cd import &&
(cd import &&
mkdir trunk branches tags &&
cd trunk &&
echo foo > foo &&
cd .. &&
(cd trunk &&
echo foo > foo
) &&
svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null &&
svn_cmd copy "$svnrepo"/trunk "$svnrepo"/branches/a \
-m "created branch a" &&
cd .. &&
-m "created branch a"
) &&
rm -rf import &&
svn_cmd co "$svnrepo"/trunk trunk &&
cd trunk &&
(cd trunk &&
echo bar >> foo &&
svn_cmd ci -m "updated trunk" &&
cd .. &&
svn_cmd ci -m "updated trunk"
) &&
svn_cmd co "$svnrepo"/branches/a a &&
cd a &&
(cd a &&
echo baz >> a &&
svn_cmd add a &&
svn_cmd ci -m "updated a" &&
cd .. &&
svn_cmd ci -m "updated a"
) &&
git svn init --stdlayout "$svnrepo"
)
'
@ -41,11 +41,11 @@ test_expect_success 'import an early SVN revision into git' '
test_expect_success 'make full git mirror of SVN' '
mkdir mirror &&
(
cd mirror &&
(cd mirror &&
git init &&
git svn init --stdlayout "$svnrepo" &&
git svn fetch &&
cd ..
git svn fetch
)
)
'

View File

@ -9,19 +9,19 @@ test_description='git svn partial-rebuild tests'
test_expect_success 'initialize svnrepo' '
mkdir import &&
(
cd import &&
(cd import &&
mkdir trunk branches tags &&
cd trunk &&
echo foo > foo &&
cd .. &&
svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null &&
cd .. &&
(cd trunk &&
echo foo > foo
) &&
svn_cmd import -m "import for git-svn" . "$svnrepo" >/dev/null
) &&
rm -rf import &&
svn_cmd co "$svnrepo"/trunk trunk &&
cd trunk &&
(cd trunk &&
echo bar >> foo &&
svn_cmd ci -m "updated trunk" &&
cd .. &&
svn_cmd ci -m "updated trunk"
) &&
rm -rf trunk
)
'

View File

@ -6,10 +6,10 @@ test_description='git svn dcommit clobber series'
test_expect_success 'initialize repo' '
mkdir import &&
cd import &&
(cd import &&
awk "BEGIN { for (i = 1; i < 64; i++) { print i } }" > file
svn_cmd import -m "initial" . "$svnrepo" &&
cd .. &&
svn_cmd import -m "initial" . "$svnrepo"
) &&
git svn init "$svnrepo" &&
git svn fetch &&
test -e file
@ -19,14 +19,14 @@ test_expect_success '(supposedly) non-conflicting change from SVN' '
test x"`sed -n -e 58p < file`" = x58 &&
test x"`sed -n -e 61p < file`" = x61 &&
svn_cmd co "$svnrepo" tmp &&
cd tmp &&
(cd tmp &&
perl -i.bak -p -e "s/^58$/5588/" file &&
perl -i.bak -p -e "s/^61$/6611/" file &&
poke file &&
test x"`sed -n -e 58p < file`" = x5588 &&
test x"`sed -n -e 61p < file`" = x6611 &&
svn_cmd commit -m "58 => 5588, 61 => 6611" &&
cd ..
svn_cmd commit -m "58 => 5588, 61 => 6611"
)
'
test_expect_success 'some unrelated changes to git' "

View File

@ -1110,11 +1110,10 @@ test_expect_success \
'P: supermodule & submodule mix' \
'git fast-import <input &&
git checkout subuse1 &&
rm -rf sub && mkdir sub && cd sub &&
rm -rf sub && mkdir sub && (cd sub &&
git init &&
git fetch --update-head-ok .. refs/heads/sub:refs/heads/master &&
git checkout master &&
cd .. &&
git checkout master) &&
git submodule init &&
git submodule update'

View File

@ -129,21 +129,22 @@ test_expect_success 'cvs co (use attributes)' '
'
test_expect_success 'adding files' '
cd cvswork/subdir &&
(cd cvswork &&
(cd subdir &&
echo "more text" > src.c &&
GIT_CONFIG="$git_config" cvs -Q add src.c >cvs.log 2>&1 &&
marked_as . src.c "" &&
echo "psuedo-binary" > temp.bin &&
cd .. &&
echo "psuedo-binary" > temp.bin
) &&
GIT_CONFIG="$git_config" cvs -Q add subdir/temp.bin >cvs.log 2>&1 &&
marked_as subdir temp.bin "-kb" &&
cd subdir &&
GIT_CONFIG="$git_config" cvs -Q ci -m "adding files" >cvs.log 2>&1 &&
marked_as . temp.bin "-kb" &&
marked_as . src.c ""
)
'
cd "$WORKDIR"
test_expect_success 'updating' '
git pull gitcvs.git &&
echo 'hi' > subdir/newfile.bin &&
@ -153,9 +154,9 @@ test_expect_success 'updating' '
git add subdir/newfile.bin subdir/file.h subdir/newfile.c binfile.bin &&
git commit -q -m "Add and change some files" &&
git push gitcvs.git >/dev/null &&
cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update &&
cd .. &&
(cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q update
) &&
marked_as cvswork textfile.c "" &&
marked_as cvswork binfile.bin -kb &&
marked_as cvswork .gitattributes "" &&
@ -233,35 +234,35 @@ test_expect_success 'cvs co another copy (guess)' '
'
test_expect_success 'add text (guess)' '
cd cvswork &&
(cd cvswork &&
echo "simpleText" > simpleText.c &&
GIT_CONFIG="$git_config" cvs -Q add simpleText.c &&
cd .. &&
GIT_CONFIG="$git_config" cvs -Q add simpleText.c
) &&
marked_as cvswork simpleText.c ""
'
test_expect_success 'add bin (guess)' '
cd cvswork &&
(cd cvswork &&
echo "simpleBin: NUL: Q <- there" | q_to_nul > simpleBin.bin &&
GIT_CONFIG="$git_config" cvs -Q add simpleBin.bin &&
cd .. &&
GIT_CONFIG="$git_config" cvs -Q add simpleBin.bin
) &&
marked_as cvswork simpleBin.bin -kb
'
test_expect_success 'remove files (guess)' '
cd cvswork &&
(cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q rm -f subdir/file.h &&
cd subdir &&
GIT_CONFIG="$git_config" cvs -Q rm -f withCr.bin &&
cd ../.. &&
(cd subdir &&
GIT_CONFIG="$git_config" cvs -Q rm -f withCr.bin
)) &&
marked_as cvswork/subdir withCr.bin -kb &&
marked_as cvswork/subdir file.h ""
'
test_expect_success 'cvs ci (guess)' '
cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q ci -m "add/rm files" >cvs.log 2>&1 &&
cd .. &&
(cd cvswork &&
GIT_CONFIG="$git_config" cvs -Q ci -m "add/rm files" >cvs.log 2>&1
) &&
marked_as cvswork textfile.c "" &&
marked_as cvswork binfile.bin -kb &&
marked_as cvswork .gitattributes "" &&
@ -278,9 +279,9 @@ test_expect_success 'cvs ci (guess)' '
'
test_expect_success 'update subdir of other copy (guess)' '
cd cvswork2/subdir &&
GIT_CONFIG="$git_config" cvs -Q update &&
cd ../.. &&
(cd cvswork2/subdir &&
GIT_CONFIG="$git_config" cvs -Q update
) &&
marked_as cvswork2 textfile.c "" &&
marked_as cvswork2 binfile.bin -kb &&
marked_as cvswork2 .gitattributes "" &&
@ -304,11 +305,11 @@ test_expect_success 'update/merge full other copy (guess)' '
git add multilineTxt.c &&
git commit -q -m "modify multiline file" >> "${WORKDIR}/marked.log" &&
git push gitcvs.git >/dev/null &&
cd cvswork2 &&
(cd cvswork2 &&
sed "s/1/replaced_1/" < multilineTxt.c > ml.temp &&
mv ml.temp multilineTxt.c &&
GIT_CONFIG="$git_config" cvs update > cvs.log 2>&1 &&
cd .. &&
GIT_CONFIG="$git_config" cvs update > cvs.log 2>&1
) &&
marked_as cvswork2 textfile.c "" &&
marked_as cvswork2 binfile.bin -kb &&
marked_as cvswork2 .gitattributes "" &&

View File

@ -14,7 +14,7 @@ test_expect_success PERL 'setup a cvs module' '
mkdir "$CVSROOT/module" &&
$CVS co -d module-cvs module &&
cd module-cvs &&
(cd module-cvs &&
cat <<EOF >o_fortuna &&
O Fortuna
velut luna
@ -38,8 +38,8 @@ add "O Fortuna" lyrics
These public domain lyrics make an excellent sample text.
EOF
$CVS commit -F message &&
cd ..
$CVS commit -F message
)
'
test_expect_success PERL 'import a trivial module' '
@ -49,7 +49,7 @@ test_expect_success PERL 'import a trivial module' '
'
test_expect_success PERL 'pack refs' 'cd module-git && git gc && cd ..'
test_expect_success PERL 'pack refs' '(cd module-git && git gc)'
test_expect_success PERL 'initial import has correct .git/cvs-revisions' '
@ -59,8 +59,7 @@ test_expect_success PERL 'initial import has correct .git/cvs-revisions' '
'
test_expect_success PERL 'update cvs module' '
cd module-cvs &&
(cd module-cvs &&
cat <<EOF >o_fortuna &&
O Fortune,
like the moon
@ -83,16 +82,16 @@ translate to English
My Latin is terrible.
EOF
$CVS commit -F message &&
cd ..
$CVS commit -F message
)
'
test_expect_success PERL 'update git module' '
cd module-git &&
(cd module-git &&
git cvsimport -a -R -z 0 module &&
git merge origin &&
cd .. &&
git merge origin
) &&
test_cmp module-cvs/o_fortuna module-git/o_fortuna
'
@ -107,21 +106,20 @@ test_expect_success PERL 'update has correct .git/cvs-revisions' '
test_expect_success PERL 'update cvs module' '
cd module-cvs &&
(cd module-cvs &&
echo 1 >tick &&
$CVS add tick &&
$CVS commit -m 1
cd ..
)
'
test_expect_success PERL 'cvsimport.module config works' '
cd module-git &&
(cd module-git &&
git config cvsimport.module module &&
git cvsimport -a -R -z0 &&
git merge origin &&
cd .. &&
git merge origin
) &&
test_cmp module-cvs/tick module-git/tick
'
@ -138,12 +136,12 @@ test_expect_success PERL 'second update has correct .git/cvs-revisions' '
test_expect_success PERL 'import from a CVS working tree' '
$CVS co -d import-from-wt module &&
cd import-from-wt &&
(cd import-from-wt &&
git cvsimport -a -z0 &&
echo 1 >expect &&
git log -1 --pretty=format:%s%n >actual &&
test_cmp actual expect &&
cd ..
test_cmp actual expect
)
'

View File

@ -19,12 +19,12 @@ setup_cvs_test_repository t9603
test_expect_failure 'import with criss cross times on revisions' '
git cvsimport -p"-x" -C module-git module &&
cd module-git &&
(cd module-git &&
git log --pretty=format:%s > ../actual-master &&
git log A~2..A --pretty="format:%s %ad" -- > ../actual-A &&
echo "" >> ../actual-master &&
echo "" >> ../actual-A &&
cd .. &&
echo "" >> ../actual-A
) &&
echo "Rev 4
Rev 3
Rev 2

View File

@ -25,7 +25,7 @@ void fast_export_modify(uint32_t depth, uint32_t *path, uint32_t mode,
uint32_t mark)
{
/* Mode must be 100644, 100755, 120000, or 160000. */
printf("M %06o :%d ", mode, mark);
printf("M %06"PRIo32" :%"PRIu32" ", mode, mark);
pool_print_seq(depth, path, '/', stdout);
putchar('\n');
}
@ -38,7 +38,8 @@ void fast_export_commit(uint32_t revision, uint32_t author, char *log,
if (!log)
log = "";
if (~uuid && ~url) {
snprintf(gitsvnline, MAX_GITSVN_LINE_LEN, "\n\ngit-svn-id: %s@%d %s\n",
snprintf(gitsvnline, MAX_GITSVN_LINE_LEN,
"\n\ngit-svn-id: %s@%"PRIu32" %s\n",
pool_fetch(url), revision, pool_fetch(uuid));
} else {
*gitsvnline = '\0';
@ -59,7 +60,7 @@ void fast_export_commit(uint32_t revision, uint32_t author, char *log,
repo_diff(revision - 1, revision);
fputc('\n', stdout);
printf("progress Imported commit %d.\n\n", revision);
printf("progress Imported commit %"PRIu32".\n\n", revision);
}
void fast_export_blob(uint32_t mode, uint32_t mark, uint32_t len)
@ -69,7 +70,7 @@ void fast_export_blob(uint32_t mode, uint32_t mark, uint32_t len)
buffer_skip_bytes(5);
len -= 5;
}
printf("blob\nmark :%d\ndata %d\n", mark, len);
printf("blob\nmark :%"PRIu32"\ndata %"PRIu32"\n", mark, len);
buffer_copy_bytes(len);
fputc('\n', stdout);
}

View File

@ -257,7 +257,7 @@ void svndump_read(const char *url)
handle_node();
active_ctx = REV_CTX;
} else {
fprintf(stderr, "Unexpected content length header: %d\n", len);
fprintf(stderr, "Unexpected content length header: %"PRIu32"\n", len);
buffer_skip_bytes(len);
}
}