Merge branch 'js/config-rename'
authorJunio C Hamano <junkio@cox.net>
Thu, 8 Mar 2007 08:53:38 +0000 (00:53 -0800)
committerJunio C Hamano <junkio@cox.net>
Thu, 8 Mar 2007 08:53:38 +0000 (00:53 -0800)
* js/config-rename:
git-config: document --rename-section, provide --remove-section

144 files changed:
Documentation/Makefile
Documentation/RelNotes-1.5.0.3.txt
Documentation/RelNotes-1.5.1.txt
Documentation/SubmittingPatches
Documentation/config.txt
Documentation/cvs-migration.txt
Documentation/git-archimport.txt
Documentation/git-diff.txt
Documentation/git-fast-import.txt
Documentation/git-fetch-pack.txt
Documentation/git-format-patch.txt
Documentation/git-receive-pack.txt
Documentation/git-update-index.txt
Documentation/git-upload-pack.txt
Documentation/git.txt
Documentation/glossary.txt
Documentation/user-manual.txt
builtin-apply.c
builtin-blame.c
builtin-branch.c
builtin-bundle.c
builtin-count-objects.c
builtin-diff-files.c
builtin-diff.c
builtin-for-each-ref.c
builtin-fsck.c
builtin-grep.c
builtin-mailinfo.c
builtin-pack-objects.c
builtin-shortlog.c
builtin-show-branch.c
builtin-update-index.c
cache.h
combine-diff.c
commit.c
config.c
contrib/emacs/Makefile
convert-objects.c
diff-lib.c
diff.c
diff.h
diffcore-break.c
diffcore-order.c
diffcore-rename.c
dir.c
entry.c
environment.c
fast-import.c
fetch-pack.c
git-archimport.perl
git-clone.sh
git-commit.sh
git-compat-util.h
git-fetch.sh
git-gui/Makefile
git-gui/git-gui.sh
git-svn.perl
gitweb/gitweb.perl
index-pack.c
interpolate.c
interpolate.h
merge-recursive.c
pack-check.c
pack-redundant.c
path.c
read-cache.c
receive-pack.c
refs.c
sha1_file.c
sha1_name.c
t/annotate-tests.sh
t/t2005-checkout-index-symlinks.sh [new file with mode: 0755]
t/t2102-update-index-symlinks.sh [new file with mode: 0755]
t/t5400-send-pack.sh
t/t5401-update-hooks.sh
t/t5515-fetch-merge-logic.sh [new file with mode: 0755]
t/t5515/fetch.br-branches-default [new file with mode: 0644]
t/t5515/fetch.br-branches-default-merge [new file with mode: 0644]
t/t5515/fetch.br-branches-default-merge_branches-default [new file with mode: 0644]
t/t5515/fetch.br-branches-default-octopus [new file with mode: 0644]
t/t5515/fetch.br-branches-default-octopus_branches-default [new file with mode: 0644]
t/t5515/fetch.br-branches-default_branches-default [new file with mode: 0644]
t/t5515/fetch.br-branches-one [new file with mode: 0644]
t/t5515/fetch.br-branches-one-merge [new file with mode: 0644]
t/t5515/fetch.br-branches-one-merge_branches-one [new file with mode: 0644]
t/t5515/fetch.br-branches-one-octopus [new file with mode: 0644]
t/t5515/fetch.br-branches-one-octopus_branches-one [new file with mode: 0644]
t/t5515/fetch.br-branches-one_branches-one [new file with mode: 0644]
t/t5515/fetch.br-config-explicit [new file with mode: 0644]
t/t5515/fetch.br-config-explicit-merge [new file with mode: 0644]
t/t5515/fetch.br-config-explicit-merge_config-explicit [new file with mode: 0644]
t/t5515/fetch.br-config-explicit-octopus [new file with mode: 0644]
t/t5515/fetch.br-config-explicit-octopus_config-explicit [new file with mode: 0644]
t/t5515/fetch.br-config-explicit_config-explicit [new file with mode: 0644]
t/t5515/fetch.br-config-glob [new file with mode: 0644]
t/t5515/fetch.br-config-glob-merge [new file with mode: 0644]
t/t5515/fetch.br-config-glob-merge_config-glob [new file with mode: 0644]
t/t5515/fetch.br-config-glob-octopus [new file with mode: 0644]
t/t5515/fetch.br-config-glob-octopus_config-glob [new file with mode: 0644]
t/t5515/fetch.br-config-glob_config-glob [new file with mode: 0644]
t/t5515/fetch.br-remote-explicit [new file with mode: 0644]
t/t5515/fetch.br-remote-explicit-merge [new file with mode: 0644]
t/t5515/fetch.br-remote-explicit-merge_remote-explicit [new file with mode: 0644]
t/t5515/fetch.br-remote-explicit-octopus [new file with mode: 0644]
t/t5515/fetch.br-remote-explicit-octopus_remote-explicit [new file with mode: 0644]
t/t5515/fetch.br-remote-explicit_remote-explicit [new file with mode: 0644]
t/t5515/fetch.br-remote-glob [new file with mode: 0644]
t/t5515/fetch.br-remote-glob-merge [new file with mode: 0644]
t/t5515/fetch.br-remote-glob-merge_remote-glob [new file with mode: 0644]
t/t5515/fetch.br-remote-glob-octopus [new file with mode: 0644]
t/t5515/fetch.br-remote-glob-octopus_remote-glob [new file with mode: 0644]
t/t5515/fetch.br-remote-glob_remote-glob [new file with mode: 0644]
t/t5515/fetch.br-unconfig [new file with mode: 0644]
t/t5515/fetch.br-unconfig_--tags_.._.git [new file with mode: 0644]
t/t5515/fetch.br-unconfig_.._.git [new file with mode: 0644]
t/t5515/fetch.br-unconfig_.._.git_one [new file with mode: 0644]
t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file [new file with mode: 0644]
t/t5515/fetch.br-unconfig_.._.git_one_two [new file with mode: 0644]
t/t5515/fetch.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file [new file with mode: 0644]
t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three [new file with mode: 0644]
t/t5515/fetch.br-unconfig_branches-default [new file with mode: 0644]
t/t5515/fetch.br-unconfig_branches-one [new file with mode: 0644]
t/t5515/fetch.br-unconfig_config-explicit [new file with mode: 0644]
t/t5515/fetch.br-unconfig_config-glob [new file with mode: 0644]
t/t5515/fetch.br-unconfig_remote-explicit [new file with mode: 0644]
t/t5515/fetch.br-unconfig_remote-glob [new file with mode: 0644]
t/t5515/fetch.master [new file with mode: 0644]
t/t5515/fetch.master_--tags_.._.git [new file with mode: 0644]
t/t5515/fetch.master_.._.git [new file with mode: 0644]
t/t5515/fetch.master_.._.git_one [new file with mode: 0644]
t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file [new file with mode: 0644]
t/t5515/fetch.master_.._.git_one_two [new file with mode: 0644]
t/t5515/fetch.master_.._.git_tag_tag-one-tree_tag_tag-three-file [new file with mode: 0644]
t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three [new file with mode: 0644]
t/t5515/fetch.master_branches-default [new file with mode: 0644]
t/t5515/fetch.master_branches-one [new file with mode: 0644]
t/t5515/fetch.master_config-explicit [new file with mode: 0644]
t/t5515/fetch.master_config-glob [new file with mode: 0644]
t/t5515/fetch.master_remote-explicit [new file with mode: 0644]
t/t5515/fetch.master_remote-glob [new file with mode: 0644]
t/t6025-merge-symlinks.sh [new file with mode: 0644]
t/t9300-fast-import.sh
upload-pack.c
xdiff-interface.c
index b6d1d8824f39557495ed479c0823f66f792b51f6..7c1c9e1918829b90aeb4e47d10aa0f5951204b0c 100644 (file)
@@ -105,8 +105,11 @@ clean:
 user-manual.xml: user-manual.txt user-manual.conf
        $(ASCIIDOC) -b docbook -d book $<
 
+XSLT = http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl
+XSLTOPTS = --nonet --xinclude --stringparam html.stylesheet docbook-xsl.css
+
 user-manual.html: user-manual.xml
-       xmlto html-nochunks $<
+       xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
 
 glossary.html : glossary.txt sort_glossary.pl
        cat $< | \
index 90b49cf27da1523326a03c17393fbc07e5572e52..cd500f96bfd73e288577b05cfdfe337d7f2b85bb 100644 (file)
@@ -1,4 +1,4 @@
-GIT v1.5.0.2 Release Notes
+GIT v1.5.0.3 Release Notes
 ==========================
 
 Fixes since v1.5.0.2
@@ -15,6 +15,10 @@ Fixes since v1.5.0.2
     path.  Earlier it started in the middle of the path, and
     incorrectly.
 
+  - 'git-merge' did not exit with non-zero status when the
+    working tree was dirty and cannot fast forward.  It does
+    now.
+
   - 'cvsexportcommit' does not lose yet-to-be-used message file.
 
   - int-vs-size_t typefix when running combined diff on files
@@ -38,18 +42,17 @@ Fixes since v1.5.0.2
   - 'git index-pack' did not protect itself from getting a short
     read out of pread(2).
 
+  - 'git http-push' had a few buffer overruns.
+
+  - Build dependency fixes to rebuild fetch.o when other headers
+    change.
+
 * Documentation updates
 
-  - options to 'git remote add' were described insufficiently.
+  - user-manual updates.
 
+  - Options to 'git remote add' were described insufficiently.
 
----
-exec >/var/tmp/1
-O=v1.5.0.2
-O=v1.5.0.2-16-gdb554bf
-echo O=`git describe maint`
-git shortlog --no-merges $O..maint
+  - Configuration format.suffix was not documented.
 
-# Local Variables:
-# mode: text
-# End:
+  - Other formatting and spelling fixes.
index aa371be1daeb75b0a9ce59fa6434ccfdb3f547bc..f374e1c2c75a597c15a9f0bbb2ff2fec6ec190df 100644 (file)
@@ -22,6 +22,9 @@ Updates since v1.5.0
   - "git diff --no-index pathA pathB" can be used as diff
     replacement with git specific enhancements.
 
+  - "git diff --pretty=format:<string>" to allow more flexible
+    custom log output.
+
   - "git name-rev" learned --refs=<pattern>, to limit the tags
     used for naming the given revisions only to the ones
     matching the given pattern.
@@ -36,6 +39,10 @@ Updates since v1.5.0
   - "git bundle" can help sneaker-netting your changes between
     repositories.
 
+  - A new configuration "core.symlinks" can be used to disable
+    symlinks on filesystems that do not support them; they are
+    checked out as regular files instead.
+
 
 * Updated behaviour of existing commands.
 
@@ -89,6 +96,9 @@ Updates since v1.5.0
 
   - "git status" in a read-only repository got a bit saner.
 
+  - "git fetch" (hence "git clone" and "git pull") are less
+    noisy when the output does not go to tty.
+
 * Hooks
 
   - The sample update hook to show how to send out notification
@@ -98,7 +108,7 @@ Updates since v1.5.0
 
 --
 exec >/var/tmp/1
-O=v1.5.0.2-259-g16d5315
+O=v1.5.0.3-268-g3ddad98
 echo O=`git describe master`
 git shortlog --no-merges $O..master ^maint
 
index 285781d9db8d337dadf5a59bbf46183d2f816fac..131bcff9b2367d63d7c8960487893bfcbfcfaa40 100644 (file)
@@ -1,3 +1,30 @@
+Checklist (and a short version for the impatient):
+
+       - make commits of logical units
+       - check for unnecessary whitespace with "git diff --check"
+         before committing
+       - do not check in commented out code or unneeded files
+       - provide a meaningful commit message
+       - the first line of the commit message should be a short
+         description and should skip the full stop
+       - if you want your work included in git.git, add a
+         "Signed-off-by: Your Name <your@email.com>" line to the
+         commit message (or just use the option "-s" when
+         committing) to confirm that you agree to the Developer's
+         Certificate of Origin
+       - do not PGP sign your patch
+       - use "git format-patch -M" to create the patch
+       - do not attach your patch, but read in the mail
+         body, unless you cannot teach your mailer to
+         leave the formatting of the patch alone.
+       - be careful doing cut & paste into your mailer, not to
+         corrupt whitespaces.
+       - provide additional information (which is unsuitable for
+         the commit message) between the "---" and the diffstat
+       - send the patch to the list _and_ the maintainer
+
+Long version:
+
 I started reading over the SubmittingPatches document for Linux
 kernel, primarily because I wanted to have a document similar to
 it for the core GIT to make sure people understand what they are
index d20902bc33226fbb7395fe4d003e9c8408eefdb2..5408dd67d316ce3334f2843267a604f5a4ea044b 100644 (file)
@@ -117,6 +117,13 @@ core.fileMode::
        the working copy are ignored; useful on broken filesystems like FAT.
        See gitlink:git-update-index[1]. True by default.
 
+core.symlinks::
+       If false, symbolic links are checked out as small plain files that
+       contain the link text. gitlink:git-update-index[1] and
+       gitlink:git-add[1] will not change the recorded type to regular
+       file. Useful on filesystems like FAT that do not support
+       symbolic links. True by default.
+
 core.gitProxy::
        A "proxy command" to execute (as 'command host port') instead
        of establishing direct connection to the remote server when
index 764cc560b4aeeb7248d94f939c976634bd395823..3b6b494162de6993ee6ffb6142fcc85b73609d9c 100644 (file)
@@ -109,7 +109,7 @@ sure it is in your path.  Then cd to a checked out CVS working directory
 of the project you are interested in and run gitlink:git-cvsimport[1]:
 
 -------------------------------------------
-$ git cvsimport -C <destination>
+$ git cvsimport -C <destination> <module>
 -------------------------------------------
 
 This puts a git archive of the named CVS module in the directory
index 5a13187a87e55b90ab0be8c32a8116200f492bbc..82cb41d2791abbd32bd8209660e9879b9f2b8f32 100644 (file)
@@ -10,7 +10,7 @@ SYNOPSIS
 --------
 [verse]
 'git-archimport' [-h] [-v] [-o] [-a] [-f] [-T] [-D depth] [-t tempdir]
-               <archive/branch> [ <archive/branch> ]
+               <archive/branch>[:<git-branch>] ...
 
 DESCRIPTION
 -----------
@@ -39,6 +39,19 @@ directory. To follow the development of a project that uses Arch, rerun
 `git-archimport` with the same parameters as the initial import to perform 
 incremental imports.
 
+While git-archimport will try to create sensible branch names for the
+archives that it imports, it is also possible to specify git branch names
+manually.  To do so, write a git branch name after each <archive/branch>
+parameter, separated by a colon.  This way, you can shorten the Arch
+branch names and convert Arch jargon to git jargon, for example mapping a
+"PROJECT--devo--VERSION" branch to "master".
+
+Associating multiple Arch branches to one git branch is possible; the
+result will make the most sense only if no commits are made to the first
+branch, after the second branch is created.  Still, this is useful to
+convert Arch repositories that had been rotated periodically.
+
+
 MERGES
 ------
 Patch merge data from Arch is used to mark merges in git as well. git 
@@ -73,7 +86,9 @@ OPTIONS
        Use this for compatibility with old-style branch names used by
        earlier versions of git-archimport.  Old-style branch names
        were category--branch, whereas new-style branch names are
-       archive,category--branch--version.
+       archive,category--branch--version.  In both cases, names given
+       on the command-line will override the automatically-generated
+       ones.
 
 -D <depth>::
        Follow merge ancestry and attempt to import trees that have been
index 12a531d1e9e4a7382f017ac303203e20abf47f2f..044cee9b425bedc7addd9a4418b553557902711b 100644 (file)
@@ -8,7 +8,7 @@ git-diff - Show changes between commits, commit and working tree, etc
 
 SYNOPSIS
 --------
-'git-diff' [ --diff-options ] <commit>{0,2} [--] [<path>...]
+'git-diff' [<common diff options>] <commit>{0,2} [--] [<path>...]
 
 DESCRIPTION
 -----------
index 77a14bb076b6d8be624345ee10e4bd14cfb2c359..7e3d2b1a96a3ef6819a0f3ccebf8f717de9d32dc 100644 (file)
@@ -62,7 +62,18 @@ OPTIONS
        Dumps the internal marks table to <file> when complete.
        Marks are written one per line as `:markid SHA-1`.
        Frontends can use this file to validate imports after they
-       have been completed.
+       have been completed, or to save the marks table across
+       incremental runs.  As <file> is only opened and truncated
+       at checkpoint (or completion) the same path can also be
+       safely given to \--import-marks.
+
+--import-marks=<file>::
+       Before processing any input, load the marks specified in
+       <file>.  The input file must exist, must be readable, and
+       must use the same format as produced by \--export-marks.
+       Multiple options may be supplied to import more than one
+       set of marks.  If a mark is defined to different values,
+       the last file wins.
 
 --export-pack-edges=<file>::
        After creating a packfile, print a line of data to
index 105d76b0ba85ecc4bd2af6dd560ae28310a5c7be..a99a5b321f763911b0d5d233a8135c5b60be6e3b 100644 (file)
@@ -8,7 +8,7 @@ git-fetch-pack - Receive missing objects from another repository
 
 SYNOPSIS
 --------
-'git-fetch-pack' [--all] [--quiet|-q] [--keep|-k] [--thin] [--upload-pack=<git-upload-pack>] [--depth=<n>] [-v] [<host>:]<directory> [<refs>...]
+'git-fetch-pack' [--all] [--quiet|-q] [--keep|-k] [--thin] [--upload-pack=<git-upload-pack>] [--depth=<n>] [--no-progress] [-v] [<host>:]<directory> [<refs>...]
 
 DESCRIPTION
 -----------
@@ -63,6 +63,9 @@ OPTIONS
 \--depth=<n>::
        Limit fetching to ancestor-chains not longer than n.
 
+\--no-progress::
+       Do not show the progress.
+
 \-v::
        Run verbosely.
 
index 59f34b9f0d2f4fe74fa5d90bb53393c88d36476b..84eabebe0bc767112805d2d35c68ad000d8e1003 100644 (file)
@@ -9,8 +9,8 @@ git-format-patch - Prepare patches for e-mail submission
 SYNOPSIS
 --------
 [verse]
-'git-format-patch' [-n | -k] [-o <dir> | --stdout] [--attach] [--thread]
-                  [-s | --signoff] [--diff-options] [--start-number <n>]
+'git-format-patch' [<common diff options>] [-n | -k] [-o <dir> | --stdout]
+                  [--attach] [--thread] [-s | --signoff] [--start-number <n>]
                   [--in-reply-to=Message-Id] [--suffix=.<sfx>]
                   [--ignore-if-in-upstream]
                   <since>[..<until>]
@@ -46,6 +46,8 @@ reference.
 
 OPTIONS
 -------
+include::diff-options.txt[]
+
 -o|--output-directory <dir>::
        Use <dir> to store the resulting files, instead of the
        current working directory.
index 10e8c46c4c0787e6a66304ca583890a438d78bb3..3cf55111cc6ecf354b79dd1d2312a5a7b1f188db 100644 (file)
@@ -25,61 +25,126 @@ The command allows for creation and fast forwarding of sha1 refs
 local end receive-pack runs, but to the user who is sitting at
 the send-pack end, it is updating the remote.  Confused?)
 
-Before each ref is updated, if $GIT_DIR/hooks/update file exists
-and executable, it is called with three parameters:
+There are other real-world examples of using update and
+post-update hooks found in the Documentation/howto directory.
 
-       $GIT_DIR/hooks/update refname sha1-old sha1-new
+git-receive-pack honours the receive.denyNonFastForwards config
+option, which tells it if updates to a ref should be denied if they
+are not fast-forwards.
+
+OPTIONS
+-------
+<directory>::
+       The repository to sync into.
+
+pre-receive Hook
+----------------
+Before any ref is updated, if $GIT_DIR/hooks/pre-receive file exists
+and is executable, it will be invoked once, with three parameters
+per ref to be updated:
+
+       $GIT_DIR/hooks/pre-receive (refname sha1-old sha1-new)+
+
+The refname parameter is relative to $GIT_DIR; e.g. for the master
+head this is "refs/heads/master".  The two sha1 arguments after
+each refname are the object names for the refname before and after
+the update.  Refs to be created will have sha1-old equal to 0{40},
+while refs to be deleted will have sha1-new equal to 0{40}, otherwise
+sha1-old and sha1-new should be valid objects in the repository.
+
+This hook is called before any refname is updated and before any
+fast-forward checks are performed.
+
+If the pre-receive hook exits with a non-zero exit status no updates
+will be performed, and the update, post-receive and post-update
+hooks will not be invoked either.  This can be useful to quickly
+bail out if the update is not to be supported.
 
-The refname parameter is relative to $GIT_DIR; e.g. for the
-master head this is "refs/heads/master".  Two sha1 are the
-object names for the refname before and after the update.  Note
-that the hook is called before the refname is updated, so either
-sha1-old is 0{40} (meaning there is no such ref yet), or it
-should match what is recorded in refname.
+update Hook
+-----------
+Before each ref is updated, if $GIT_DIR/hooks/update file exists
+and is executable, it is invoked once per ref, with three parameters:
 
-The hook should exit with non-zero status if it wants to
-disallow updating the named ref.  Otherwise it should exit with
-zero.
+       $GIT_DIR/hooks/update refname sha1-old sha1-new
 
-Using this hook, it is easy to generate mails on updates to
-the local repository. This example script sends a mail with
-the commits pushed to the repository:
+The refname parameter is relative to $GIT_DIR; e.g. for the master
+head this is "refs/heads/master".  The two sha1 arguments are
+the object names for the refname before and after the update.
+Note that the hook is called before the refname is updated,
+so either sha1-old is 0{40} (meaning there is no such ref yet),
+or it should match what is recorded in refname.
+
+The hook should exit with non-zero status if it wants to disallow
+updating the named ref.  Otherwise it should exit with zero.
+
+Successful execution (a zero exit status) of this hook does not
+ensure the ref will actully be updated, it is only a prerequisite.
+As such it is not a good idea to send notices (e.g. email) from
+this hook.  Consider using the post-receive hook instead.
+
+post-receive Hook
+-----------------
+After all refs were updated (or attempted to be updated), if any
+ref update was successful, and if $GIT_DIR/hooks/post-receive
+file exists and is executable, it will be invoke once with three
+parameters for each successfully updated ref:
+
+       $GIT_DIR/hooks/post-receive (refname sha1-old sha1-new)+
+
+The refname parameter is relative to $GIT_DIR; e.g. for the master
+head this is "refs/heads/master".  The two sha1 arguments after
+each refname are the object names for the refname before and after
+the update.  Refs that were created will have sha1-old equal to
+0{40}, while refs that were deleted will have sha1-new equal to
+0{40}, otherwise sha1-old and sha1-new should be valid objects in
+the repository.
+
+Using this hook, it is easy to generate mails describing the updates
+to the repository.  This example script sends one mail message per
+ref listing the commits pushed to the repository:
 
        #!/bin/sh
        # mail out commit update information.
-       if expr "$2" : '0*$' >/dev/null
-       then
-               echo "Created a new ref, with the following commits:"
-               git-rev-list --pretty "$2"
-       else
-               echo "New commits:"
-               git-rev-list --pretty "$3" "^$2"
-       fi |
-       mail -s "Changes to ref $1" commit-list@mydomain
+       while test $# -gt 0
+       do
+               if expr "$2" : '0*$' >/dev/null
+               then
+                       echo "Created a new ref, with the following commits:"
+                       git-rev-list --pretty "$2"
+               else
+                       echo "New commits:"
+                       git-rev-list --pretty "$3" "^$2"
+               fi |
+               mail -s "Changes to ref $1" commit-list@mydomain
+               shift; shift; shift; # discard this ref's args
+       done
        exit 0
 
-Another hook $GIT_DIR/hooks/post-update, if exists and
-executable, is called with the list of refs that have been
-updated.  This can be used to implement repository wide cleanup
-task if needed.  The exit code from this hook invocation is
-ignored; the only thing left for git-receive-pack to do at that
-point is to exit itself anyway.  This hook can be used, for
-example, to run "git-update-server-info" if the repository is
-packed and is served via a dumb transport.
+The exit code from this hook invocation is ignored, however a
+non-zero exit code will generate an error message.
 
-       #!/bin/sh
-       exec git-update-server-info
+Note that it is possible for refname to not have sha1-new when this
+hook runs.  This can easily occur if another user modifies the ref
+after it was updated by receive-pack, but before the hook was able
+to evaluate it.  It is recommended that hooks rely on sha1-new
+rather than the current value of refname.
 
-There are other real-world examples of using update and
-post-update hooks found in the Documentation/howto directory.
+post-update Hook
+----------------
+After all other processing, if at least one ref was updated, and
+if $GIT_DIR/hooks/post-update file exists and is executable, then
+post-update will called with the list of refs that have been updated.
+This can be used to implement any repository wide cleanup tasks.
 
-git-receive-pack honours the receive.denyNonFastforwards flag, which
-tells it if updates to a ref should be denied if they are not fast-forwards.
+The exit code from this hook invocation is ignored; the only thing
+left for git-receive-pack to do at that point is to exit itself
+anyway.
 
-OPTIONS
--------
-<directory>::
-       The repository to sync into.
+This hook can be used, for example, to run "git-update-server-info"
+if the repository is packed and is served via a dumb transport.
+
+       #!/bin/sh
+       exec git-update-server-info
 
 
 SEE ALSO
index b161c8b32b196b2e251ee65ee43e5aa0349b96b4..cd5e014d4899954b204173f6e1d84e011a307ac8 100644 (file)
@@ -295,6 +295,11 @@ in the index and the file mode on the filesystem if they differ only on
 executable bit.   On such an unfortunate filesystem, you may
 need to use `git-update-index --chmod=`.
 
+Quite similarly, if `core.symlinks` configuration variable is set
+to 'false' (see gitlink:git-config[1]), symbolic links are checked out
+as plain files, and this command does not modify a recorded file mode
+from symbolic link to regular file.
+
 The command looks at `core.ignorestat` configuration variable.  See
 'Using "assume unchanged" bit' section above.
 
index 9da062d5c94aa631317fbcdc8b07443e58374bd8..fd6519299a9a089a1ffec544f55ba40775aedf9b 100644 (file)
@@ -8,7 +8,7 @@ git-upload-pack - Send objects packed back to git-fetch-pack
 
 SYNOPSIS
 --------
-'git-upload-pack' <directory>
+'git-upload-pack' [--strict] [--timeout=<n>] <directory>
 
 DESCRIPTION
 -----------
@@ -23,6 +23,13 @@ repository.  For push operations, see 'git-send-pack'.
 
 OPTIONS
 -------
+
+\--strict::
+       Do not try <directory>/.git/ if <directory> is no git directory.
+
+\--timeout=<n>::
+       Interrupt transfer after <n> seconds of inactivity.
+
 <directory>::
        The repository to sync from.
 
index 9a7474798963c22b554f49db015c180b9ae7ea4f..e875e8318d24fa046c7cddfc3e583b4c242d9302 100644 (file)
@@ -35,14 +35,14 @@ ifdef::stalenotes[]
 You are reading the documentation for the latest version of git.
 Documentation for older releases are available here:
 
-* link:v1.5.0.2/git.html[documentation for release 1.5.0.2]
+* link:v1.5.0.3/git.html[documentation for release 1.5.0.3]
+
+* link:v1.5.0.3/RelNotes-1.5.0.3.txt[release notes for 1.5.0.3]
 
 * link:v1.5.0.2/RelNotes-1.5.0.2.txt[release notes for 1.5.0.2]
 
 * link:v1.5.0.1/RelNotes-1.5.0.1.txt[release notes for 1.5.0.1]
 
-* link:v1.5.0/git.html[documentation for release 1.5.0]
-
 * link:v1.5.0/RelNotes-1.5.0.txt[release notes for 1.5.0]
 
 * link:v1.4.4.4/git.html[documentation for release 1.4.4.4]
@@ -241,6 +241,12 @@ Identifier Terminology
        operate on a <tree> object but automatically dereferences
        <commit> and <tag> objects that point at a <tree>.
 
+<commit-ish>::
+       Indicates a commit or tag object name.  A
+       command that takes a <commit-ish> argument ultimately wants to
+       operate on a <commit> object but automatically dereferences
+       <tag> objects that point at a <commit>.
+
 <type>::
        Indicates that an object type is required.
        Currently one of: `blob`, `tree`, `commit`, or `tag`.
index d20eb6270cd795ab61b281154a7e24070519b7fb..9f446241e2dabee4b93f5c1625351f2260e73717 100644 (file)
@@ -73,6 +73,11 @@ DAG::
        objects is acyclic (there is no chain which begins and ends with the
        same object).
 
+dangling object::
+       An unreachable object which is not reachable even from other
+       unreachable objects; a dangling object has no references to it
+       from any reference or object in the repository.
+
 dircache::
        You are *waaaaay* behind.
 
@@ -350,6 +355,10 @@ tag::
 unmerged index::
        An index which contains unmerged index entries.
 
+unreachable object::
+       An object which is not reachable from a branch, tag, or any
+       other reference.
+
 working tree::
        The set of files and directories currently being worked on,
        i.e. you can work in your working tree without using git at all.
index 34e965104b892ff0353064f254414cb744da85d4..ffd673ec335c3d85d6815dcfdc3e1bfd019f8551 100644 (file)
@@ -391,15 +391,20 @@ index 8be626f..d7aac9d 100644
 As you can see, a commit shows who made the latest change, what they
 did, and why.
 
-Every commit has a 40-hexdigit id, sometimes called the "object name"
-or the "SHA1 id", shown on the first line of the "git show" output.
-You can usually refer to a commit by a shorter name, such as a tag or a
-branch name, but this longer name can also be useful.  Most
-importantly, it is a globally unique name for this commit: so if you
-tell somebody else the object name (for example in email), then you are
-guaranteed that name will refer to the same commit in their repository
-that it does in yours (assuming their repository has that commit at
-all).
+Every commit has a 40-hexdigit id, sometimes called the "object name" or the
+"SHA1 id", shown on the first line of the "git show" output.  You can usually
+refer to a commit by a shorter name, such as a tag or a branch name, but this
+longer name can also be useful.  Most importantly, it is a globally unique
+name for this commit: so if you tell somebody else the object name (for
+example in email), then you are guaranteed that name will refer to the same
+commit in their repository that it does in yours (assuming their repository
+has that commit at all).  Since the object name is computed as a hash over the
+contents of the commit, you are guaranteed that the commit can never change
+without its name also changing.
+
+In fact, in <<git-internals>> we shall see that everything stored in git
+history, including file data and directory contents, is stored in an object
+with a name that is a hash of its contents.
 
 Understanding history: commits, parents, and reachability
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -1163,18 +1168,46 @@ the working tree in a special state that gives you all the
 information you need to help resolve the merge.
 
 Files with conflicts are marked specially in the index, so until you
-resolve the problem and update the index, git commit will fail:
+resolve the problem and update the index, gitlink:git-commit[1] will
+fail:
 
 -------------------------------------------------
 $ git commit
 file.txt: needs merge
 -------------------------------------------------
 
-Also, git status will list those files as "unmerged".
+Also, gitlink:git-status[1] will list those files as "unmerged", and the
+files with conflicts will have conflict markers added, like this:
+
+-------------------------------------------------
+<<<<<<< HEAD:file.txt
+Hello world
+=======
+Goodbye
+>>>>>>> 77976da35a11db4580b80ae27e8d65caf5208086:file.txt
+-------------------------------------------------
+
+All you need to do is edit the files to resolve the conflicts, and then
+
+-------------------------------------------------
+$ git add file.txt
+$ git commit
+-------------------------------------------------
+
+Note that the commit message will already be filled in for you with
+some information about the merge.  Normally you can just use this
+default message unchanged, but you may add additional commentary of
+your own if desired.
+
+The above is all you need to know to resolve a simple merge.  But git
+also provides more information to help resolve conflicts:
+
+Getting conflict-resolution help during a merge
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 All of the changes that git was able to merge automatically are
 already added to the index file, so gitlink:git-diff[1] shows only
-the conflicts.  Also, it uses a somewhat unusual syntax:
+the conflicts.  It uses an unusual syntax:
 
 -------------------------------------------------
 $ git diff
@@ -1195,14 +1228,32 @@ conflict will have two parents instead of the usual one: one parent
 will be HEAD, the tip of the current branch; the other will be the
 tip of the other branch, which is stored temporarily in MERGE_HEAD.
 
-The diff above shows the differences between the working-tree version
-of file.txt and two previous versions: one version from HEAD, and one
-from MERGE_HEAD.  So instead of preceding each line by a single "+"
-or "-", it now uses two columns: the first column is used for
-differences between the first parent and the working directory copy,
-and the second for differences between the second parent and the
-working directory copy.  Thus after resolving the conflict in the
-obvious way, the diff will look like:
+During the merge, the index holds three versions of each file.  Each of
+these three "file stages" represents a different version of the file:
+
+-------------------------------------------------
+$ git show :1:file.txt # the file in a common ancestor of both branches
+$ git show :2:file.txt # the version from HEAD, but including any
+                       # nonconflicting changes from MERGE_HEAD
+$ git show :3:file.txt # the version from MERGE_HEAD, but including any
+                       # nonconflicting changes from HEAD.
+-------------------------------------------------
+
+Since the stage 2 and stage 3 versions have already been updated with
+nonconflicting changes, the only remaining differences between them are
+the important ones; thus gitlink:git-diff[1] can use the information in
+the index to show only those conflicts.
+
+The diff above shows the differences between the working-tree version of
+file.txt and the stage 2 and stage 3 versions.  So instead of preceding
+each line by a single "+" or "-", it now uses two columns: the first
+column is used for differences between the first parent and the working
+directory copy, and the second for differences between the second parent
+and the working directory copy.  (See the "COMBINED DIFF FORMAT" section
+of gitlink:git-diff-files[1] for a details of the format.)
+
+After resolving the conflict in the obvious way (but before updating the
+index), the diff will look like:
 
 -------------------------------------------------
 $ git diff
@@ -1220,26 +1271,37 @@ This shows that our resolved version deleted "Hello world" from the
 first parent, deleted "Goodbye" from the second parent, and added
 "Goodbye world", which was previously absent from both.
 
-The gitlink:git-log[1] command also provides special help for merges:
+Some special diff options allow diffing the working directory against
+any of these stages:
+
+-------------------------------------------------
+$ git diff -1 file.txt         # diff against stage 1
+$ git diff --base file.txt     # same as the above
+$ git diff -2 file.txt         # diff against stage 2
+$ git diff --ours file.txt     # same as the above
+$ git diff -3 file.txt         # diff against stage 3
+$ git diff --theirs file.txt   # same as the above.
+-------------------------------------------------
+
+The gitlink:git-log[1] and gitk[1] commands also provide special help
+for merges:
 
 -------------------------------------------------
 $ git log --merge
+$ gitk --merge
 -------------------------------------------------
 
-This will list all commits which exist only on HEAD or on MERGE_HEAD,
-and which touch an unmerged file.
+These will display all commits which exist only on HEAD or on
+MERGE_HEAD, and which touch an unmerged file.
 
-We can now add the resolved version to the index and commit:
+Each time you resolve the conflicts in a file and update the index:
 
 -------------------------------------------------
 $ git add file.txt
-$ git commit
 -------------------------------------------------
 
-Note that the commit message will already be filled in for you with
-some information about the merge.  Normally you can just use this
-default message unchanged, but you may add additional commentary of
-your own if desired.
+the different stages of that file will be "collapsed", after which
+git-diff will (by default) no longer show diffs for that file.
 
 [[undoing-a-merge]]
 undoing a merge
@@ -1255,7 +1317,7 @@ $ git reset --hard HEAD
 Or, if you've already commited the merge that you want to throw away,
 
 -------------------------------------------------
-$ git reset --hard HEAD^
+$ git reset --hard ORIG_HEAD
 -------------------------------------------------
 
 However, this last command can be dangerous in some cases--never
@@ -1328,6 +1390,7 @@ with the changes to be reverted, then you will be asked to fix
 conflicts manually, just as in the case of <<resolving-a-merge,
 resolving a merge>>.
 
+[[fixing-a-mistake-by-editing-history]]
 Fixing a mistake by editing history
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -1930,6 +1993,51 @@ return mywork to the state it had before you started the rebase:
 $ git rebase --abort
 -------------------------------------------------
 
+Modifying a single commit
+-------------------------
+
+We saw in <<fixing-a-mistake-by-editing-history>> that you can replace the
+most recent commit using
+
+-------------------------------------------------
+$ git commit --amend
+-------------------------------------------------
+
+which will replace the old commit by a new commit incorporating your
+changes, giving you a chance to edit the old commit message first.
+
+You can also use a combination of this and gitlink:git-rebase[1] to edit
+commits further back in your history.  First, tag the problematic commit with
+
+-------------------------------------------------
+$ git tag bad mywork~5
+-------------------------------------------------
+
+(Either gitk or git-log may be useful for finding the commit.)
+
+Then check out a new branch at that commit, edit it, and rebase the rest of
+the series on top of it:
+
+-------------------------------------------------
+$ git checkout -b TMP bad
+$ # make changes here and update the index
+$ git commit --amend
+$ git rebase --onto TMP bad mywork
+-------------------------------------------------
+
+When you're done, you'll be left with mywork checked out, with the top patches
+on mywork reapplied on top of the modified commit you created in TMP.  You can
+then clean up with
+
+-------------------------------------------------
+$ git branch -d TMP
+$ git tag -d bad
+-------------------------------------------------
+
+Note that the immutable nature of git history means that you haven't really
+"modified" existing commits; instead, you have replaced the old commits with
+new commits having new object names.
+
 Reordering or selecting from a patch series
 -------------------------------------------
 
@@ -2155,6 +2263,7 @@ See gitlink:git-config[1] for more details on the configuration
 options mentioned above.
 
 
+[[git-internals]]
 Git internals
 =============
 
@@ -2936,11 +3045,6 @@ provides.
 Simplify beginning by suggesting disconnected head instead of
 temporary branch creation?
 
-Explain how to refer to file stages in the "how to resolve a merge"
-section: diff -1, -2, -3, --ours, --theirs :1:/path notation.  The
-"git ls-files --unmerged --stage" thing is sorta useful too,
-actually.  And note gitk --merge.
-
 Add more good examples.  Entire sections of just cookbook examples
 might be a good idea; maybe make an "advanced examples" section a
 standard end-of-chapter section?
index 38f647510a13f51e63a35aaf442aeb154e34915c..dfa17167963d1318298208e880be1cae47d06ea9 100644 (file)
@@ -1981,7 +1981,7 @@ static int apply_data(struct patch *patch, struct stat *st, struct cache_entry *
                }
        }
        else if (patch->old_name) {
-               size = st->st_size;
+               size = xsize_t(st->st_size);
                alloc = size + 8192;
                buf = xmalloc(alloc);
                if (read_old_data(st, patch->old_name, &buf, &alloc, &size))
@@ -2359,7 +2359,7 @@ static int try_create_file(const char *path, unsigned int mode, const char *buf,
        char *nbuf;
        unsigned long nsize;
 
-       if (S_ISLNK(mode))
+       if (has_symlinks && S_ISLNK(mode))
                /* Although buf:size is counted string, it also is NUL
                 * terminated.
                 */
index 9f7dd4e19f042ce91c4c21fb73e8e3f69ca78a76..b51cdc71faeca467cd3a965db0ff84d1f087076d 100644 (file)
@@ -1244,26 +1244,26 @@ static void pass_blame(struct scoreboard *sb, struct origin *origin, int opt)
  */
 struct commit_info
 {
-       char *author;
-       char *author_mail;
+       const char *author;
+       const char *author_mail;
        unsigned long author_time;
-       char *author_tz;
+       const char *author_tz;
 
        /* filled only when asked for details */
-       char *committer;
-       char *committer_mail;
+       const char *committer;
+       const char *committer_mail;
        unsigned long committer_time;
-       char *committer_tz;
+       const char *committer_tz;
 
-       char *summary;
+       const char *summary;
 };
 
 /*
  * Parse author/committer line in the commit object buffer
  */
 static void get_ac_line(const char *inbuf, const char *what,
-                       int bufsz, char *person, char **mail,
-                       unsigned long *time, char **tz)
+                       int bufsz, char *person, const char **mail,
+                       unsigned long *time, const char **tz)
 {
        int len;
        char *tmp, *endp;
@@ -1280,7 +1280,7 @@ static void get_ac_line(const char *inbuf, const char *what,
        if (bufsz <= len) {
        error_out:
                /* Ugh */
-               person = *mail = *tz = "(unknown)";
+               *mail = *tz = "(unknown)";
                *time = 0;
                return;
        }
@@ -1963,7 +1963,7 @@ static struct commit *fake_working_tree_commit(const char *path, const char *con
                                die("Cannot lstat %s", path);
                        read_from = path;
                }
-               fin_size = st.st_size;
+               fin_size = xsize_t(st.st_size);
                buf = xmalloc(fin_size+1);
                mode = canon_mode(st.st_mode);
                switch (st.st_mode & S_IFMT) {
index d3718496553078dfb4ceac2413c758457e102592..06d8a8ce0432134f994aa30ac4133baf4ba7fef5 100644 (file)
@@ -289,12 +289,13 @@ static void print_ref_list(int kinds, int detached, int verbose, int abbrev)
        detached = (detached && (kinds & REF_LOCAL_BRANCH));
        if (detached) {
                struct ref_item item;
-               item.name = "(no branch)";
+               item.name = xstrdup("(no branch)");
                item.kind = REF_LOCAL_BRANCH;
                hashcpy(item.sha1, head_sha1);
                if (strlen(item.name) > ref_list.maxwidth)
                              ref_list.maxwidth = strlen(item.name);
                print_ref_item(&item, ref_list.maxwidth, verbose, abbrev, 1);
+               free(item.name);
        }
 
        for (i = 0; i < ref_list.index; i++) {
index d41a413b58d139283315720d9ffba95ea595cc1d..279b8f8e582665dda3c99d800094db2f5cf5af99 100644 (file)
@@ -263,6 +263,11 @@ static void show_object(struct object_array_entry *p)
        write_or_die(1, "\n", 1);
 }
 
+static void show_edge(struct commit *commit)
+{
+       ; /* nothing to do */
+}
+
 static int create_bundle(struct bundle_header *header, const char *path,
                int argc, const char **argv)
 {
@@ -341,6 +346,7 @@ static int create_bundle(struct bundle_header *header, const char *path,
        dup2(in, 1);
        close(in);
        prepare_revision_walk(&revs);
+       mark_edges_uninteresting(revs.commits, &revs, show_edge);
        traverse_commit_list(&revs, show_commit, show_object);
        close(1);
        while (waitpid(pid, &status, 0) < 0)
index f5b22bb80e23aef6acde2533701b7b56150948b6..6263d8af295a5abce3e417157af7cb41e3623f38 100644 (file)
@@ -44,7 +44,7 @@ static void count_objects(DIR *d, char *path, int len, int verbose,
                        if (lstat(path, &st) || !S_ISREG(st.st_mode))
                                bad = 1;
                        else
-                               (*loose_size) += st.st_blocks;
+                               (*loose_size) += xsize_t(st.st_blocks);
                }
                if (bad) {
                        if (verbose) {
index e1199f80ae34a53872ca6a74ae9678053e33db14..aec83384298042fc4509605299f82e82745ae675 100644 (file)
@@ -23,7 +23,10 @@ int cmd_diff_files(int argc, const char **argv, const char *prefix)
        git_config(git_default_config); /* no "diff" UI options */
        rev.abbrev = 0;
 
-       argc = setup_revisions(argc, argv, &rev, NULL);
+       if (!setup_diff_no_index(&rev, argc, argv, nongit, prefix))
+               argc = 0;
+       else
+               argc = setup_revisions(argc, argv, &rev, NULL);
        if (!rev.diffopt.output_format)
                rev.diffopt.output_format = DIFF_FORMAT_RAW;
        return run_diff_files_cmd(&rev, argc, argv);
index 28b660a780f9f2ae48acf5e8d3dc7c7aee178de2..4efbb8237bd49e8717a42833b2d9b2db064b45ac 100644 (file)
@@ -215,7 +215,10 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
        git_config(git_diff_ui_config);
        init_revisions(&rev, prefix);
 
-       argc = setup_revisions(argc, argv, &rev, NULL);
+       if (!setup_diff_no_index(&rev, argc, argv, nongit, prefix))
+               argc = 0;
+       else
+               argc = setup_revisions(argc, argv, &rev, NULL);
        if (!rev.diffopt.output_format) {
                rev.diffopt.output_format = DIFF_FORMAT_PATCH;
                if (diff_setup_done(&rev.diffopt) < 0)
index b11ca928d6ac353de888f0e80d24578c5803d769..2b218425aab2c37a826bfbe22535f2e5b7002a26 100644 (file)
@@ -301,7 +301,7 @@ static const char *find_wholine(const char *who, int wholen, const char *buf, un
        return "";
 }
 
-static char *copy_line(const char *buf)
+static const char *copy_line(const char *buf)
 {
        const char *eol = strchr(buf, '\n');
        char *line;
@@ -315,7 +315,7 @@ static char *copy_line(const char *buf)
        return line;
 }
 
-static char *copy_name(const char *buf)
+static const char *copy_name(const char *buf)
 {
        const char *eol = strchr(buf, '\n');
        const char *eoname = strstr(buf, " <");
@@ -330,7 +330,7 @@ static char *copy_name(const char *buf)
        return line;
 }
 
-static char *copy_email(const char *buf)
+static const char *copy_email(const char *buf)
 {
        const char *email = strchr(buf, '<');
        const char *eoemail = strchr(email, '>');
index 6abf498d2b391c97e9efcdb32da1cf3b5d566397..39cfc32818dc80d8bda04ff45fbf5996d1506922 100644 (file)
@@ -632,7 +632,7 @@ int cmd_fsck(int argc, char **argv, const char *prefix)
                        verify_pack(p, 0);
 
                for (p = packed_git; p; p = p->next) {
-                       int num = num_packed_objects(p);
+                       uint32_t i, num = num_packed_objects(p);
                        for (i = 0; i < num; i++) {
                                unsigned char sha1[20];
                                nth_packed_object_sha1(p, i, sha1);
index 96b70227cf073517c309dbc8b042085f1040dab5..694da5ba09d302c1e44f863070776bc3ac7f32e2 100644 (file)
@@ -122,6 +122,8 @@ static int grep_file(struct grep_opt *opt, const char *filename)
        struct stat st;
        int i;
        char *data;
+       size_t sz;
+
        if (lstat(filename, &st) < 0) {
        err_ret:
                if (errno != ENOENT)
@@ -132,11 +134,12 @@ static int grep_file(struct grep_opt *opt, const char *filename)
                return 0; /* empty file -- no grep hit */
        if (!S_ISREG(st.st_mode))
                return 0;
+       sz = xsize_t(st.st_size);
        i = open(filename, O_RDONLY);
        if (i < 0)
                goto err_ret;
-       data = xmalloc(st.st_size + 1);
-       if (st.st_size != read_in_full(i, data, st.st_size)) {
+       data = xmalloc(sz + 1);
+       if (st.st_size != read_in_full(i, data, sz)) {
                error("'%s': short read %s", filename, strerror(errno));
                close(i);
                free(data);
@@ -145,11 +148,12 @@ static int grep_file(struct grep_opt *opt, const char *filename)
        close(i);
        if (opt->relative && opt->prefix_length)
                filename += opt->prefix_length;
-       i = grep_buffer(opt, filename, data, st.st_size);
+       i = grep_buffer(opt, filename, data, sz);
        free(data);
        return i;
 }
 
+#ifdef __unix__
 static int exec_grep(int argc, const char **argv)
 {
        pid_t pid;
@@ -298,6 +302,7 @@ static int external_grep(struct grep_opt *opt, const char **paths, int cached)
        }
        return hit;
 }
+#endif
 
 static int grep_cache(struct grep_opt *opt, const char **paths, int cached)
 {
index 766a37ebe2da56f92be3927d6ddfe46dba9386df..f54e8752fb6dd0f7f251fe6bfe7bf3b2f8cd91f3 100644 (file)
@@ -545,10 +545,10 @@ static int decode_b_segment(char *in, char *ot, char *ep)
        return 0;
 }
 
-static void convert_to_utf8(char *line, char *charset)
+static void convert_to_utf8(char *line, const char *charset)
 {
-       static char latin_one[] = "latin1";
-       char *input_charset = *charset ? charset : latin_one;
+       static const char latin_one[] = "latin1";
+       const char *input_charset = *charset ? charset : latin_one;
        char *out = reencode_string(line, metainfo_charset, input_charset);
 
        if (!out)
index 8cf24f407915e6988b86a0ee40a4884dab9f5358..f8ebad0b2f2006d619dc06814acb6024ee674eec 100644 (file)
@@ -23,7 +23,7 @@ git-pack-objects [{ -q | --progress | --all-progress }] \n\
 struct object_entry {
        unsigned char sha1[20];
        unsigned long size;     /* uncompressed size */
-       unsigned long offset;   /* offset into the final pack file;
+       off_t offset;   /* offset into the final pack file;
                                 * nonzero if already written.
                                 */
        unsigned int depth;     /* delta depth */
@@ -35,7 +35,7 @@ struct object_entry {
 #define in_pack_header_size delta_size /* only when reusing pack data */
        struct object_entry *delta;     /* delta base object */
        struct packed_git *in_pack;     /* already in pack */
-       unsigned int in_pack_offset;
+       off_t in_pack_offset;
        struct object_entry *delta_child; /* deltified objects who bases me */
        struct object_entry *delta_sibling; /* other deltified objects who
                                             * uses the same base as me
@@ -68,7 +68,7 @@ static int allow_ofs_delta;
 
 static struct object_entry **sorted_by_sha, **sorted_by_type;
 static struct object_entry *objects;
-static int nr_objects, nr_alloc, nr_result;
+static uint32_t nr_objects, nr_alloc, nr_result;
 static const char *base_name;
 static unsigned char pack_file_sha1[20];
 static int progress = 1;
@@ -101,7 +101,7 @@ static int object_ix_hashsz;
  * get the object sha1 from the main index.
  */
 struct revindex_entry {
-       unsigned int offset;
+       off_t offset;
        unsigned int nr;
 };
 struct pack_revindex {
@@ -114,10 +114,8 @@ static int pack_revindex_hashsz;
 /*
  * stats
  */
-static int written;
-static int written_delta;
-static int reused;
-static int reused_delta;
+static uint32_t written, written_delta;
+static uint32_t reused, reused_delta;
 
 static int pack_revindex_ix(struct packed_git *p)
 {
@@ -185,7 +183,7 @@ static void prepare_pack_revindex(struct pack_revindex *rix)
 }
 
 static struct revindex_entry * find_packed_object(struct packed_git *p,
-                                                 unsigned int ofs)
+                                                 off_t ofs)
 {
        int num;
        int lo, hi;
@@ -213,15 +211,14 @@ static struct revindex_entry * find_packed_object(struct packed_git *p,
        die("internal error: pack revindex corrupt");
 }
 
-static unsigned long find_packed_object_size(struct packed_git *p,
-                                            unsigned long ofs)
+static off_t find_packed_object_size(struct packed_git *p, off_t ofs)
 {
        struct revindex_entry *entry = find_packed_object(p, ofs);
        return entry[1].offset - ofs;
 }
 
 static unsigned char *find_packed_object_name(struct packed_git *p,
-                                             unsigned long ofs)
+                                             off_t ofs)
 {
        struct revindex_entry *entry = find_packed_object(p, ofs);
        return (unsigned char *)(p->index_base + 256) + 24 * entry->nr + 4;
@@ -278,8 +275,8 @@ static int encode_header(enum object_type type, unsigned long size, unsigned cha
  */
 static int check_pack_inflate(struct packed_git *p,
                struct pack_window **w_curs,
-               unsigned long offset,
-               unsigned long len,
+               off_t offset,
+               off_t len,
                unsigned long expect)
 {
        z_stream stream;
@@ -305,8 +302,8 @@ static int check_pack_inflate(struct packed_git *p,
 static void copy_pack_data(struct sha1file *f,
                struct packed_git *p,
                struct pack_window **w_curs,
-               unsigned long offset,
-               unsigned long len)
+               off_t offset,
+               off_t len)
 {
        unsigned char *in;
        unsigned int avail;
@@ -314,7 +311,7 @@ static void copy_pack_data(struct sha1file *f,
        while (len) {
                in = use_pack(p, w_curs, offset, &avail);
                if (avail > len)
-                       avail = len;
+                       avail = (unsigned int)len;
                sha1write(f, in, avail);
                offset += avail;
                len -= avail;
@@ -371,14 +368,15 @@ static int revalidate_loose_object(struct object_entry *entry,
        return check_loose_inflate(map, mapsize, size);
 }
 
-static unsigned long write_object(struct sha1file *f,
+static off_t write_object(struct sha1file *f,
                                  struct object_entry *entry)
 {
        unsigned long size;
        enum object_type type;
        void *buf;
        unsigned char header[10];
-       unsigned hdrlen, datalen;
+       unsigned hdrlen;
+       off_t datalen;
        enum object_type obj_type;
        int to_reuse = 0;
 
@@ -441,7 +439,7 @@ static unsigned long write_object(struct sha1file *f,
                         * encoding of the relative offset for the delta
                         * base from this object's position in the pack.
                         */
-                       unsigned long ofs = entry->offset - entry->delta->offset;
+                       off_t ofs = entry->offset - entry->delta->offset;
                        unsigned pos = sizeof(header) - 1;
                        header[pos] = ofs & 127;
                        while (ofs >>= 7)
@@ -462,7 +460,7 @@ static unsigned long write_object(struct sha1file *f,
        else {
                struct packed_git *p = entry->in_pack;
                struct pack_window *w_curs = NULL;
-               unsigned long offset;
+               off_t offset;
 
                if (entry->delta) {
                        obj_type = (allow_ofs_delta && entry->delta->offset) ?
@@ -472,7 +470,7 @@ static unsigned long write_object(struct sha1file *f,
                hdrlen = encode_header(obj_type, entry->size, header);
                sha1write(f, header, hdrlen);
                if (obj_type == OBJ_OFS_DELTA) {
-                       unsigned long ofs = entry->offset - entry->delta->offset;
+                       off_t ofs = entry->offset - entry->delta->offset;
                        unsigned pos = sizeof(header) - 1;
                        header[pos] = ofs & 127;
                        while (ofs >>= 7)
@@ -500,9 +498,9 @@ static unsigned long write_object(struct sha1file *f,
        return hdrlen + datalen;
 }
 
-static unsigned long write_one(struct sha1file *f,
+static off_t write_one(struct sha1file *f,
                               struct object_entry *e,
-                              unsigned long offset)
+                              off_t offset)
 {
        if (e->offset || e->preferred_base)
                /* offset starts from header size and cannot be zero
@@ -518,9 +516,9 @@ static unsigned long write_one(struct sha1file *f,
 
 static void write_pack_file(void)
 {
-       int i;
+       uint32_t i;
        struct sha1file *f;
-       unsigned long offset;
+       off_t offset;
        struct pack_header hdr;
        unsigned last_percent = 999;
        int do_progress = progress;
@@ -533,7 +531,7 @@ static void write_pack_file(void)
                f = sha1create("%s-%s.%s", base_name,
                               sha1_to_hex(object_list_sha1), "pack");
        if (do_progress)
-               fprintf(stderr, "Writing %d objects.\n", nr_result);
+               fprintf(stderr, "Writing %u objects.\n", nr_result);
 
        hdr.hdr_signature = htonl(PACK_SIGNATURE);
        hdr.hdr_version = htonl(PACK_VERSION);
@@ -558,13 +556,13 @@ static void write_pack_file(void)
                fputc('\n', stderr);
  done:
        if (written != nr_result)
-               die("wrote %d objects while expecting %d", written, nr_result);
+               die("wrote %u objects while expecting %u", written, nr_result);
        sha1close(f, pack_file_sha1, 1);
 }
 
 static void write_index_file(void)
 {
-       int i;
+       uint32_t i;
        struct sha1file *f = sha1create("%s-%s.%s", base_name,
                                        sha1_to_hex(object_list_sha1), "idx");
        struct object_entry **list = sorted_by_sha;
@@ -633,7 +631,7 @@ static struct object_entry *locate_object_entry(const unsigned char *sha1)
 
 static void rehash_objects(void)
 {
-       int i;
+       uint32_t i;
        struct object_entry *oe;
 
        object_ix_hashsz = nr_objects * 3;
@@ -670,16 +668,16 @@ static unsigned name_hash(const char *name)
 
 static int add_object_entry(const unsigned char *sha1, unsigned hash, int exclude)
 {
-       unsigned int idx = nr_objects;
+       uint32_t idx = nr_objects;
        struct object_entry *entry;
        struct packed_git *p;
-       unsigned int found_offset = 0;
+       off_t found_offset = 0;
        struct packed_git *found_pack = NULL;
        int ix, status = 0;
 
        if (!exclude) {
                for (p = packed_git; p; p = p->next) {
-                       unsigned long offset = find_pack_entry_one(sha1, p);
+                       off_t offset = find_pack_entry_one(sha1, p);
                        if (offset) {
                                if (incremental)
                                        return 0;
@@ -696,9 +694,8 @@ static int add_object_entry(const unsigned char *sha1, unsigned hash, int exclud
                goto already_added;
 
        if (idx >= nr_alloc) {
-               unsigned int needed = (idx + 1024) * 3 / 2;
-               objects = xrealloc(objects, needed * sizeof(*entry));
-               nr_alloc = needed;
+               nr_alloc = (idx + 1024) * 3 / 2;
+               objects = xrealloc(objects, nr_alloc * sizeof(*entry));
        }
        entry = objects + idx;
        nr_objects = idx + 1;
@@ -718,7 +715,7 @@ static int add_object_entry(const unsigned char *sha1, unsigned hash, int exclud
 
  already_added:
        if (progress_update) {
-               fprintf(stderr, "Counting objects...%d\r", nr_objects);
+               fprintf(stderr, "Counting objects...%u\r", nr_objects);
                progress_update = 0;
        }
        if (exclude)
@@ -981,17 +978,17 @@ static void check_object(struct object_entry *entry)
        if (entry->in_pack && !entry->preferred_base) {
                struct packed_git *p = entry->in_pack;
                struct pack_window *w_curs = NULL;
-               unsigned long left = p->pack_size - entry->in_pack_offset;
                unsigned long size, used;
+               unsigned int avail;
                unsigned char *buf;
                struct object_entry *base_entry = NULL;
 
-               buf = use_pack(p, &w_curs, entry->in_pack_offset, NULL);
+               buf = use_pack(p, &w_curs, entry->in_pack_offset, &avail);
 
                /* We want in_pack_type even if we do not reuse delta.
                 * There is no point not reusing non-delta representations.
                 */
-               used = unpack_object_header_gently(buf, left,
+               used = unpack_object_header_gently(buf, avail,
                                                   &entry->in_pack_type, &size);
 
                /* Check if it is delta, and the base is also an object
@@ -1000,7 +997,7 @@ static void check_object(struct object_entry *entry)
                 */
                if (!no_reuse_delta) {
                        unsigned char c, *base_name;
-                       unsigned long ofs;
+                       off_t ofs;
                        unsigned long used_0;
                        /* there is at least 20 bytes left in the pack */
                        switch (entry->in_pack_type) {
@@ -1081,7 +1078,7 @@ static unsigned int check_delta_limit(struct object_entry *me, unsigned int n)
 
 static void get_object_details(void)
 {
-       int i;
+       uint32_t i;
        struct object_entry *entry;
 
        prepare_pack_ix();
@@ -1120,7 +1117,7 @@ static int sort_comparator(const void *_a, const void *_b)
 static struct object_entry **create_sorted_list(entry_sort_t sort)
 {
        struct object_entry **list = xmalloc(nr_objects * sizeof(struct object_entry *));
-       int i;
+       uint32_t i;
 
        for (i = 0; i < nr_objects; i++)
                list[i] = objects + i;
@@ -1137,7 +1134,7 @@ static int sha1_sort(const struct object_entry *a, const struct object_entry *b)
 static struct object_entry **create_final_object_list(void)
 {
        struct object_entry **list;
-       int i, j;
+       uint32_t i, j;
 
        for (i = nr_result = 0; i < nr_objects; i++)
                if (!objects[i].preferred_base)
@@ -1279,20 +1276,20 @@ static void progress_interval(int signum)
 
 static void find_deltas(struct object_entry **list, int window, int depth)
 {
-       int i, idx;
+       uint32_t i = nr_objects, idx = 0, processed = 0;
        unsigned int array_size = window * sizeof(struct unpacked);
-       struct unpacked *array = xmalloc(array_size);
-       unsigned processed = 0;
+       struct unpacked *array;
        unsigned last_percent = 999;
 
+       if (!nr_objects)
+               return;
+       array = xmalloc(array_size);
        memset(array, 0, array_size);
-       i = nr_objects;
-       idx = 0;
        if (progress)
-               fprintf(stderr, "Deltifying %d objects.\n", nr_result);
+               fprintf(stderr, "Deltifying %u objects.\n", nr_result);
 
-       while (--i >= 0) {
-               struct object_entry *entry = list[i];
+       do {
+               struct object_entry *entry = list[--i];
                struct unpacked *n = array + idx;
                int j;
 
@@ -1325,7 +1322,7 @@ static void find_deltas(struct object_entry **list, int window, int depth)
 
                j = window;
                while (--j > 0) {
-                       unsigned int other_idx = idx + j;
+                       uint32_t other_idx = idx + j;
                        struct unpacked *m;
                        if (other_idx >= window)
                                other_idx -= window;
@@ -1345,7 +1342,7 @@ static void find_deltas(struct object_entry **list, int window, int depth)
                idx++;
                if (idx >= window)
                        idx = 0;
-       }
+       } while (i > 0);
 
        if (progress)
                fputc('\n', stderr);
@@ -1386,7 +1383,7 @@ static int reuse_cached_pack(unsigned char *sha1)
        }
 
        if (progress)
-               fprintf(stderr, "Reusing %d objects pack %s\n", nr_objects,
+               fprintf(stderr, "Reusing %u objects pack %s\n", nr_objects,
                        sha1_to_hex(sha1));
 
        if (pack_to_stdout) {
@@ -1537,7 +1534,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
        struct object_entry **list;
        int use_internal_rev_list = 0;
        int thin = 0;
-       int i;
+       uint32_t i;
        const char **rp_av;
        int rp_ac_alloc = 64;
        int rp_ac;
@@ -1670,7 +1667,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
        }
 
        if (progress)
-               fprintf(stderr, "Done counting %d objects.\n", nr_objects);
+               fprintf(stderr, "Done counting %u objects.\n", nr_objects);
        sorted_by_sha = create_final_object_list();
        if (non_empty && !nr_result)
                return 0;
@@ -1683,7 +1680,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
        }
        SHA1_Final(object_list_sha1, &ctx);
        if (progress && (nr_objects != nr_result))
-               fprintf(stderr, "Result has %d objects.\n", nr_result);
+               fprintf(stderr, "Result has %u objects.\n", nr_result);
 
        if (reuse_cached_pack(object_list_sha1))
                ;
@@ -1704,7 +1701,7 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
                }
        }
        if (progress)
-               fprintf(stderr, "Total %d (delta %d), reused %d (delta %d)\n",
+               fprintf(stderr, "Total %u (delta %u), reused %u (delta %u)\n",
                        written, written_delta, reused, reused_delta);
        return 0;
 }
index 2f71a2a6e2ecf556956a0271d8af9ad852d5a93c..2d7726e8b975d9977e14638cc127ed0b30d3058b 100644 (file)
@@ -217,13 +217,13 @@ static void get_from_rev(struct rev_info *rev, struct path_list *list)
 
        prepare_revision_walk(rev);
        while ((commit = get_revision(rev)) != NULL) {
-               char *author = NULL, *oneline, *buffer;
+               const char *author = NULL, *oneline, *buffer;
                int authorlen = authorlen, onelinelen;
 
                /* get author and oneline */
                for (buffer = commit->buffer; buffer && *buffer != '\0' &&
                                *buffer != '\n'; ) {
-                       char *eol = strchr(buffer, '\n');
+                       const char *eol = strchr(buffer, '\n');
 
                        if (eol == NULL)
                                eol = buffer + strlen(buffer);
index 67ae6bacda6edda2e36b974c0d36b4611ef1a9a6..c892f1f7a643b3d7e5c298837424a72cbc2c4f78 100644 (file)
@@ -721,7 +721,8 @@ int cmd_show_branch(int ac, const char **av, const char *prefix)
                }
 
                for (i = 0; i < reflog; i++) {
-                       char *logmsg, *msg, *m;
+                       char *logmsg, *m;
+                       const char *msg;
                        unsigned long timestamp;
                        int tz;
 
index 65246dad8d075de3f77454494c419000288c9ed2..71cef633c0e36b3a33fa29eccb8579a9304b0777 100644 (file)
@@ -109,11 +109,11 @@ static int add_file_to_cache(const char *path)
        ce->ce_flags = htons(namelen);
        fill_stat_cache_info(ce, &st);
 
-       if (trust_executable_bit)
+       if (trust_executable_bit && has_symlinks)
                ce->ce_mode = create_ce_mode(st.st_mode);
        else {
-               /* If there is an existing entry, pick the mode bits
-                * from it, otherwise assume unexecutable.
+               /* If there is an existing entry, pick the mode bits and type
+                * from it, otherwise assume unexecutable regular file.
                 */
                struct cache_entry *ent;
                int pos = cache_name_pos(path, namelen);
diff --git a/cache.h b/cache.h
index 8018b2cd3b20533ea03ce503bc88b8bd0155432e..ae25759c433a29caeb8662ef3ccfe4c0f3422bd5 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -108,7 +108,10 @@ static inline unsigned int create_ce_mode(unsigned int mode)
 }
 static inline unsigned int ce_mode_from_stat(struct cache_entry *ce, unsigned int mode)
 {
-       extern int trust_executable_bit;
+       extern int trust_executable_bit, has_symlinks;
+       if (!has_symlinks && S_ISREG(mode) &&
+           ce && S_ISLNK(ntohl(ce->ce_mode)))
+               return ce->ce_mode;
        if (!trust_executable_bit && S_ISREG(mode)) {
                if (ce && S_ISREG(ntohl(ce->ce_mode)))
                        return ce->ce_mode;
@@ -215,6 +218,7 @@ extern int delete_ref(const char *, unsigned char *sha1);
 /* Environment bits from configuration mechanism */
 extern int use_legacy_headers;
 extern int trust_executable_bit;
+extern int has_symlinks;
 extern int assume_unchanged;
 extern int prefer_symlink_refs;
 extern int log_all_ref_updates;
@@ -379,7 +383,7 @@ extern struct packed_git {
 } *packed_git;
 
 struct pack_entry {
-       unsigned int offset;
+       off_t offset;
        unsigned char sha1[20];
        struct packed_git *p;
 };
@@ -418,15 +422,15 @@ extern struct packed_git *find_sha1_pack(const unsigned char *sha1,
                                         struct packed_git *packs);
 
 extern void pack_report(void);
-extern unsigned char* use_pack(struct packed_git *, struct pack_window **, unsigned long, unsigned int *);
+extern unsigned char* use_pack(struct packed_git *, struct pack_window **, off_t, unsigned int *);
 extern void unuse_pack(struct pack_window **);
 extern struct packed_git *add_packed_git(char *, int, int);
-extern int num_packed_objects(const struct packed_git *p);
-extern int nth_packed_object_sha1(const struct packed_git *, int, unsigned char*);
-extern unsigned long find_pack_entry_one(const unsigned char *, struct packed_git *);
-extern void *unpack_entry(struct packed_git *, unsigned long, enum object_type *, unsigned long *);
+extern uint32_t num_packed_objects(const struct packed_git *p);
+extern int nth_packed_object_sha1(const struct packed_git *, uint32_t, unsigned char*);
+extern off_t find_pack_entry_one(const unsigned char *, struct packed_git *);
+extern void *unpack_entry(struct packed_git *, off_t, enum object_type *, unsigned long *);
 extern unsigned long unpack_object_header_gently(const unsigned char *buf, unsigned long len, enum object_type *type, unsigned long *sizep);
-extern const char *packed_object_info_detail(struct packed_git *, unsigned long, unsigned long *, unsigned long *, unsigned int *, unsigned char *);
+extern const char *packed_object_info_detail(struct packed_git *, off_t, unsigned long *, unsigned long *, unsigned int *, unsigned char *);
 
 /* Dumb servers support */
 extern int update_server_info(int);
@@ -447,7 +451,7 @@ extern char git_default_email[MAX_GITNAME];
 extern char git_default_name[MAX_GITNAME];
 
 extern char *git_commit_encoding;
-extern char *git_log_output_encoding;
+extern const char *git_log_output_encoding;
 
 extern int copy_fd(int ifd, int ofd);
 extern int read_in_full(int fd, void *buf, size_t count);
index 9daa0cb9a95fe6c2176a927f093d8788d0195240..3a9b32f6b8882f3adb91e5833c205635657a98b7 100644 (file)
@@ -684,7 +684,7 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
                        goto deleted_file;
 
                if (S_ISLNK(st.st_mode)) {
-                       size_t len = st.st_size;
+                       size_t len = xsize_t(st.st_size);
                        result_size = len;
                        result = xmalloc(len + 1);
                        if (result_size != readlink(elem->path, result, len)) {
@@ -697,10 +697,20 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
                }
                else if (0 <= (fd = open(elem->path, O_RDONLY)) &&
                         !fstat(fd, &st)) {
-                       size_t len = st.st_size;
+                       size_t len = xsize_t(st.st_size);
                        size_t sz = 0;
+                       int is_file, i;
 
                        elem->mode = canon_mode(st.st_mode);
+                       /* if symlinks don't work, assume symlink if all parents
+                        * are symlinks
+                        */
+                       is_file = has_symlinks;
+                       for (i = 0; !is_file && i < num_parent; i++)
+                               is_file = !S_ISLNK(elem->parent[i].mode);
+                       if (!is_file)
+                               elem->mode = canon_mode(S_IFLNK);
+
                        result_size = len;
                        result = xmalloc(len + 1);
                        while (sz < len) {
index 555252734298540ffc5678ac5d80888fd23dd4e5..5b9234e12e8d1ef46d0d53b15cea850dfbde14c2 100644 (file)
--- a/commit.c
+++ b/commit.c
@@ -651,7 +651,7 @@ static char *get_header(const struct commit *commit, const char *key)
        }
 }
 
-static char *replace_encoding_header(char *buf, char *encoding)
+static char *replace_encoding_header(char *buf, const char *encoding)
 {
        char *encoding_header = strstr(buf, "\nencoding ");
        char *end_of_encoding_header;
@@ -694,29 +694,26 @@ static char *replace_encoding_header(char *buf, char *encoding)
 }
 
 static char *logmsg_reencode(const struct commit *commit,
-                            char *output_encoding)
+                            const char *output_encoding)
 {
+       static const char *utf8 = "utf-8";
+       const char *use_encoding;
        char *encoding;
        char *out;
-       char *utf8 = "utf-8";
 
        if (!*output_encoding)
                return NULL;
        encoding = get_header(commit, "encoding");
-       if (!encoding)
-               encoding = utf8;
-       if (!strcmp(encoding, output_encoding))
+       use_encoding = encoding ? encoding : utf8;
+       if (!strcmp(use_encoding, output_encoding))
                out = strdup(commit->buffer);
        else
                out = reencode_string(commit->buffer,
-                                     output_encoding, encoding);
+                                     output_encoding, use_encoding);
        if (out)
                out = replace_encoding_header(out, output_encoding);
 
-       if (encoding != utf8)
-               free(encoding);
-       if (!out)
-               return NULL;
+       free(encoding);
        return out;
 }
 
@@ -917,7 +914,7 @@ unsigned long pretty_print_commit(enum cmit_fmt fmt,
        const char *msg = commit->buffer;
        int plain_non_ascii = 0;
        char *reencoded;
-       char *encoding;
+       const char *encoding;
 
        if (fmt == CMIT_FMT_USERFORMAT)
                return format_commit_message(commit, msg, buf, space);
index 5611d7a6a63885b8be20f7f638185f8f92fa745f..a3c7b772bce1d302e60bbf02212bb4ad4da0ee7b 100644 (file)
--- a/config.c
+++ b/config.c
@@ -269,6 +269,11 @@ int git_default_config(const char *var, const char *value)
                return 0;
        }
 
+       if (!strcmp(var, "core.symlinks")) {
+               has_symlinks = git_config_bool(var, value);
+               return 0;
+       }
+
        if (!strcmp(var, "core.bare")) {
                is_bare_repository_cfg = git_config_bool(var, value);
                return 0;
@@ -426,7 +431,7 @@ static struct {
        int do_not_match;
        regex_t* value_regex;
        int multi_replace;
-       off_t offset[MAX_MATCHES];
+       size_t offset[MAX_MATCHES];
        enum { START, SECTION_SEEN, SECTION_END_SEEN, KEY_SEEN } state;
        int seen;
 } store;
@@ -574,11 +579,11 @@ static int store_write_pair(int fd, const char* key, const char* value)
        return 1;
 }
 
-static int find_beginning_of_line(const char* contents, int size,
-       int offset_, int* found_bracket)
+static ssize_t find_beginning_of_line(const char* contents, size_t size,
+       size_t offset_, int* found_bracket)
 {
-       int equal_offset = size, bracket_offset = size;
-       int offset;
+       size_t equal_offset = size, bracket_offset = size;
+       ssize_t offset;
 
        for (offset = offset_-2; offset > 0 
                        && contents[offset] != '\n'; offset--)
@@ -722,7 +727,8 @@ int git_config_set_multivar(const char* key, const char* value,
        } else {
                struct stat st;
                char* contents;
-               int i, copy_begin, copy_end, new_line = 0;
+               size_t contents_sz, copy_begin, copy_end;
+               int i, new_line = 0;
 
                if (value_regex == NULL)
                        store.value_regex = NULL;
@@ -779,7 +785,8 @@ int git_config_set_multivar(const char* key, const char* value,
                }
 
                fstat(in_fd, &st);
-               contents = xmmap(NULL, st.st_size, PROT_READ,
+               contents_sz = xsize_t(st.st_size);
+               contents = xmmap(NULL, contents_sz, PROT_READ,
                        MAP_PRIVATE, in_fd, 0);
                close(in_fd);
 
@@ -788,12 +795,12 @@ int git_config_set_multivar(const char* key, const char* value,
 
                for (i = 0, copy_begin = 0; i < store.seen; i++) {
                        if (store.offset[i] == 0) {
-                               store.offset[i] = copy_end = st.st_size;
+                               store.offset[i] = copy_end = contents_sz;
                        } else if (store.state != KEY_SEEN) {
                                copy_end = store.offset[i];
                        } else
                                copy_end = find_beginning_of_line(
-                                       contents, st.st_size,
+                                       contents, contents_sz,
                                        store.offset[i]-2, &new_line);
 
                        /* write the first part of the config */
@@ -820,13 +827,13 @@ int git_config_set_multivar(const char* key, const char* value,
                }
 
                /* write the rest of the config */
-               if (copy_begin < st.st_size)
+               if (copy_begin < contents_sz)
                        if (write_in_full(fd, contents + copy_begin,
-                                         st.st_size - copy_begin) <
-                           st.st_size - copy_begin)
+                                         contents_sz - copy_begin) <
+                           contents_sz - copy_begin)
                                goto write_err_out;
 
-               munmap(contents, st.st_size);
+               munmap(contents, contents_sz);
                unlink(config_filename);
        }
 
index 350846de904b31fb9dd86fee0c64613a7632c6aa..8554e3967cc692c6916e5aee35952074d07e8bf0 100644 (file)
@@ -2,7 +2,7 @@
 
 EMACS = emacs
 
-ELC = git.elc vc-git.elc
+ELC = git.elc vc-git.elc git-blame.elc
 INSTALL ?= install
 INSTALL_ELC = $(INSTALL) -m 644
 prefix ?= $(HOME)
@@ -15,6 +15,6 @@ install: all
        $(INSTALL_ELC) $(ELC) $(emacsdir)
 
 %.elc: %.el
-       $(EMACS) --batch --eval '(byte-compile-file "$<")'
+       $(EMACS) -batch -f batch-byte-compile $<
 
 clean:; rm -f $(ELC)
index b5f41ae2e38c1f7856d7f060955eed5da0aea036..4809f9199fa21dcd95ab508e26196080d49e8e88 100644 (file)
@@ -132,7 +132,7 @@ static void convert_tree(void *buffer, unsigned long size, unsigned char *result
        unsigned long orig_size = size;
 
        while (size) {
-               int len = 1+strlen(buffer);
+               size_t len = 1+strlen(buffer);
 
                convert_binary_sha1((char *) buffer + len);
 
index 2e916199066db068d80ff5168b3feee6cfba7056..778cf58244d64b1e1b14ead43c2fdf5735bd717f 100644 (file)
@@ -200,6 +200,72 @@ static int handle_diff_files_args(struct rev_info *revs,
        return 0;
 }
 
+static int is_outside_repo(const char *path, int nongit, const char *prefix)
+{
+       int i;
+       if (nongit || !strcmp(path, "-") || path[0] == '/')
+               return 1;
+       if (prefixcmp(path, "../"))
+               return 0;
+       if (!prefix)
+               return 1;
+       for (i = strlen(prefix); !prefixcmp(path, "../"); ) {
+               while (i > 0 && prefix[i - 1] != '/')
+                       i--;
+               if (--i < 0)
+                       return 1;
+               path += 3;
+       }
+       return 0;
+}
+
+int setup_diff_no_index(struct rev_info *revs,
+               int argc, const char ** argv, int nongit, const char *prefix)
+{
+       int i;
+       for (i = 1; i < argc; i++)
+               if (argv[i][0] != '-')
+                       break;
+               else if (!strcmp(argv[i], "--")) {
+                       i++;
+                       break;
+               } else if (i < argc - 3 && !strcmp(argv[i], "--no-index")) {
+                       i = argc - 3;
+                       break;
+               }
+       if (argc != i + 2 || (!is_outside_repo(argv[i + 1], nongit, prefix) &&
+                               !is_outside_repo(argv[i], nongit, prefix)))
+               return -1;
+
+       diff_setup(&revs->diffopt);
+       for (i = 1; i < argc - 2; )
+               if (!strcmp(argv[i], "--no-index"))
+                       i++;
+               else {
+                       int j = diff_opt_parse(&revs->diffopt,
+                                       argv + i, argc - i);
+                       if (!j)
+                               die("invalid diff option/value: %s", argv[i]);
+                       i += j;
+               }
+
+       if (prefix) {
+               int len = strlen(prefix);
+
+               revs->diffopt.paths = xcalloc(2, sizeof(char*));
+               for (i = 0; i < 2; i++) {
+                       const char *p;
+                       p = prefix_filename(prefix, len, argv[argc - 2 + i]);
+                       revs->diffopt.paths[i] = xstrdup(p);
+               }
+       }
+       else
+               revs->diffopt.paths = argv + argc - 2;
+       revs->diffopt.nr_paths = 2;
+       revs->max_count = -2;
+       return 0;
+}
+
 int run_diff_files_cmd(struct rev_info *revs, int argc, const char **argv)
 {
        int silent_on_removed;
@@ -346,6 +412,9 @@ int run_diff_files(struct rev_info *revs, int silent_on_removed)
                    S_ISREG(newmode) && S_ISREG(oldmode) &&
                    ((newmode ^ oldmode) == 0111))
                        newmode = oldmode;
+               else if (!has_symlinks &&
+                   S_ISREG(newmode) && S_ISLNK(oldmode))
+                       newmode = oldmode;
                diff_change(&revs->diffopt, oldmode, newmode,
                            ce->sha1, (changed ? null_sha1 : ce->sha1),
                            ce->name, NULL);
diff --git a/diff.c b/diff.c
index e225de230599bb35d9fe5b219ff4b8e8de9bfd97..8f7a7d110857f2dcfcdb577da08df8deaf720cf7 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -1399,7 +1399,7 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only)
                                return err;
                        }
                }
-               s->size = st.st_size;
+               s->size = xsize_t(st.st_size);
                if (!s->size)
                        goto empty;
                if (size_only)
@@ -1515,12 +1515,13 @@ static void prepare_temp_file(const char *name,
                if (S_ISLNK(st.st_mode)) {
                        int ret;
                        char buf[PATH_MAX + 1]; /* ought to be SYMLINK_MAX */
+                       size_t sz = xsize_t(st.st_size);
                        if (sizeof(buf) <= st.st_size)
                                die("symlink too long: %s", name);
-                       ret = readlink(name, buf, st.st_size);
+                       ret = readlink(name, buf, sz);
                        if (ret < 0)
                                die("readlink(%s)", name);
-                       prep_temp_blob(temp, buf, st.st_size,
+                       prep_temp_blob(temp, buf, sz,
                                       (one->sha1_valid ?
                                        one->sha1 : null_sha1),
                                       (one->sha1_valid ?
@@ -2138,7 +2139,7 @@ static int parse_num(const char **cp_p)
        /* user says num divided by scale and we say internally that
         * is MAX_SCORE * num / scale.
         */
-       return (num >= scale) ? MAX_SCORE : (MAX_SCORE * num / scale);
+       return (int)((num >= scale) ? MAX_SCORE : (MAX_SCORE * num / scale));
 }
 
 int diff_scoreopt_parse(const char *opt)
diff --git a/diff.h b/diff.h
index 4043cec04e0ae1da13a6049c9f30c4184f6b1da4..4b435e8b1933222da02f9e4cf2c28d2fef44d292 100644 (file)
--- a/diff.h
+++ b/diff.h
@@ -222,6 +222,8 @@ extern void diff_flush(struct diff_options*);
 extern const char *diff_unique_abbrev(const unsigned char *, int);
 
 extern int run_diff_files(struct rev_info *revs, int silent_on_removed);
+extern int setup_diff_no_index(struct rev_info *revs,
+               int argc, const char ** argv, int nongit, const char *prefix);
 extern int run_diff_files_cmd(struct rev_info *revs, int argc, const char **argv);
 
 extern int run_diff_index(struct rev_info *revs, int cached);
index acb18db1db27dc29fdb76bd519174aa56f56121d..9c19b8cab778362b9d369135e743fb232a7cd295 100644 (file)
@@ -89,7 +89,7 @@ static int should_break(struct diff_filespec *src,
         * merge the surviving pair together if the score is
         * less than the minimum, after rename/copy runs.
         */
-       *merge_score_p = src_removed * MAX_SCORE / src->size;
+       *merge_score_p = (int)(src_removed * MAX_SCORE / src->size);
 
        /* Extent of damage, which counts both inserts and
         * deletes.
index 7ad09461858aa6832b828df411fd1b736f035465..2a4bd8232eb185f195c513c3509a72a92d172818 100644 (file)
@@ -14,6 +14,7 @@ static void prepare_order(const char *orderfile)
        void *map;
        char *cp, *endp;
        struct stat st;
+       size_t sz;
 
        if (order)
                return;
@@ -25,11 +26,12 @@ static void prepare_order(const char *orderfile)
                close(fd);
                return;
        }
-       map = mmap(NULL, st.st_size, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
+       sz = xsize_t(st.st_size);
+       map = mmap(NULL, sz, PROT_READ|PROT_WRITE, MAP_PRIVATE, fd, 0);
        close(fd);
        if (map == MAP_FAILED)
                return;
-       endp = (char *) map + st.st_size;
+       endp = (char *) map + sz;
        for (pass = 0; pass < 2; pass++) {
                cnt = 0;
                cp = map;
index 91fa2bea519a39ee65dcf018b7a72885b9eeec70..79030412dbf883147f35678505ad147dc9c240a8 100644 (file)
@@ -172,7 +172,8 @@ static int estimate_similarity(struct diff_filespec *src,
                return 0; /* error but caught downstream */
 
 
-       delta_limit = base_size * (MAX_SCORE-minimum_score) / MAX_SCORE;
+       delta_limit = (unsigned long)
+               (base_size * (MAX_SCORE-minimum_score) / MAX_SCORE);
        if (diffcore_count_changes(src->data, src->size,
                                   dst->data, dst->size,
                                   &src->cnt_data, &dst->cnt_data,
@@ -186,7 +187,7 @@ static int estimate_similarity(struct diff_filespec *src,
        if (!dst->size)
                score = 0; /* should not happen */
        else
-               score = src_copied * MAX_SCORE / max_size;
+               score = (int)(src_copied * MAX_SCORE / max_size);
        return score;
 }
 
@@ -297,7 +298,7 @@ void diffcore_rename(struct diff_options *options)
                                struct diff_filespec *one = rename_src[j].one;
                                if (!is_exact_match(one, two, contents_too))
                                        continue;
-                               record_rename_pair(i, j, MAX_SCORE);
+                               record_rename_pair(i, j, (int)MAX_SCORE);
                                rename_count++;
                                break; /* we are done with this entry */
                        }
diff --git a/dir.c b/dir.c
index 32b57f0125d1b9e95345eb23a9a32fbf8444b1b8..b48e19dc09fff7d7fb1d5b48673fe4448b69a7c3 100644 (file)
--- a/dir.c
+++ b/dir.c
@@ -130,13 +130,13 @@ static int add_excludes_from_file_1(const char *fname,
 {
        struct stat st;
        int fd, i;
-       long size;
+       size_t size;
        char *buf, *entry;
 
        fd = open(fname, O_RDONLY);
        if (fd < 0 || fstat(fd, &st) < 0)
                goto err;
-       size = st.st_size;
+       size = xsize_t(st.st_size);
        if (size == 0) {
                close(fd);
                return 0;
diff --git a/entry.c b/entry.c
index 21b5f2e26d77a2e7b10a6336d9e14db72b1f7e45..d72f811580ad10e792e38b40fe79bf4af3868846 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -111,9 +111,12 @@ static int write_entry(struct cache_entry *ce, char *path, struct checkout *stat
                        return error("git-checkout-index: unable to write file %s", path);
                break;
        case S_IFLNK:
-               if (to_tempfile) {
-                       strcpy(path, ".merge_link_XXXXXX");
-                       fd = mkstemp(path);
+               if (to_tempfile || !has_symlinks) {
+                       if (to_tempfile) {
+                               strcpy(path, ".merge_link_XXXXXX");
+                               fd = mkstemp(path);
+                       } else
+                               fd = create_file(path, 0666);
                        if (fd < 0) {
                                free(new);
                                return error("git-checkout-index: unable to create "
index 570e32ac3cae2c1502a49a6ca1aacebb52f42ce0..0151ad07227d20a7f8d4a5c390d77b2aa85ef739 100644 (file)
@@ -13,6 +13,7 @@ char git_default_email[MAX_GITNAME];
 char git_default_name[MAX_GITNAME];
 int use_legacy_headers = 1;
 int trust_executable_bit = 1;
+int has_symlinks = 1;
 int assume_unchanged;
 int prefer_symlink_refs;
 int is_bare_repository_cfg = -1; /* unspecified */
@@ -20,7 +21,7 @@ int log_all_ref_updates = -1; /* unspecified */
 int warn_ambiguous_refs = 1;
 int repository_format_version;
 char *git_commit_encoding;
-char *git_log_output_encoding;
+const char *git_log_output_encoding;
 int shared_repository = PERM_UMASK;
 const char *apply_default_whitespace;
 int zlib_compression_level = Z_DEFAULT_COMPRESSION;
index 65e99c2e8b14840f70c027deb360d5d3c5292959..726f5ba7d2a8b16e0fb62846f3ede631d99486d3 100644 (file)
@@ -133,10 +133,6 @@ Format of STDIN stream:
 #define PACK_ID_BITS 16
 #define MAX_PACK_ID ((1<<PACK_ID_BITS)-1)
 
-#ifndef PRIuMAX
-#define PRIuMAX "llu"
-#endif
-
 struct object_entry
 {
        struct object_entry *next;
@@ -220,7 +216,8 @@ struct branch
        const char *name;
        struct tree_entry branch_tree;
        uintmax_t last_commit;
-       unsigned int pack_id;
+       unsigned active : 1;
+       unsigned pack_id : PACK_ID_BITS;
        unsigned char sha1[20];
 };
 
@@ -252,7 +249,7 @@ typedef enum {
 
 /* Configured limits on output */
 static unsigned long max_depth = 10;
-static unsigned long max_packsize = (1LL << 32) - 1;
+static off_t max_packsize = (1LL << 32) - 1;
 static int force_update;
 
 /* Stats and misc. counters */
@@ -528,6 +525,7 @@ static struct branch *new_branch(const char *name)
        b->table_next_branch = branch_table[hc];
        b->branch_tree.versions[0].mode = S_IFDIR;
        b->branch_tree.versions[1].mode = S_IFDIR;
+       b->active = 0;
        b->pack_id = MAX_PACK_ID;
        branch_table[hc] = b;
        branch_count++;
@@ -755,7 +753,7 @@ static char *create_index(void)
 static char *keep_pack(char *curr_index_name)
 {
        static char name[PATH_MAX];
-       static char *keep_msg = "fast-import";
+       static const char *keep_msg = "fast-import";
        int keep_fd;
 
        chmod(pack_data->pack_name, 0444);
@@ -1373,16 +1371,33 @@ static void dump_marks_helper(FILE *f,
 
 static void dump_marks(void)
 {
-       if (mark_file)
-       {
-               FILE *f = fopen(mark_file, "w");
-               if (f) {
-                       dump_marks_helper(f, 0, marks);
-                       fclose(f);
-               } else
-                       failure |= error("Unable to write marks file %s: %s",
-                               mark_file, strerror(errno));
+       static struct lock_file mark_lock;
+       int mark_fd;
+       FILE *f;
+
+       if (!mark_file)
+               return;
+
+       mark_fd = hold_lock_file_for_update(&mark_lock, mark_file, 0);
+       if (mark_fd < 0) {
+               failure |= error("Unable to write marks file %s: %s",
+                       mark_file, strerror(errno));
+               return;
+       }
+
+       f = fdopen(mark_fd, "w");
+       if (!f) {
+               rollback_lock_file(&mark_lock);
+               failure |= error("Unable to write marks file %s: %s",
+                       mark_file, strerror(errno));
+               return;
        }
+
+       dump_marks_helper(f, 0, marks);
+       fclose(f);
+       if (commit_lock_file(&mark_lock))
+               failure |= error("Unable to write marks file %s: %s",
+                       mark_file, strerror(errno));
 }
 
 static void read_next_command(void)
@@ -1529,7 +1544,7 @@ static void unload_one_branch(void)
 {
        while (cur_active_branches
                && cur_active_branches >= max_active_branches) {
-               unsigned long min_commit = ULONG_MAX;
+               uintmax_t min_commit = ULONG_MAX;
                struct branch *e, *l = NULL, *p = NULL;
 
                for (e = active_branches; e; e = e->active_next_branch) {
@@ -1547,6 +1562,7 @@ static void unload_one_branch(void)
                        e = active_branches;
                        active_branches = e->active_next_branch;
                }
+               e->active = 0;
                e->active_next_branch = NULL;
                if (e->branch_tree.tree) {
                        release_tree_content_recursive(e->branch_tree.tree);
@@ -1559,10 +1575,13 @@ static void unload_one_branch(void)
 static void load_branch(struct branch *b)
 {
        load_tree(&b->branch_tree);
-       b->active_next_branch = active_branches;
-       active_branches = b;
-       cur_active_branches++;
-       branch_load_count++;
+       if (!b->active) {
+               b->active = 1;
+               b->active_next_branch = active_branches;
+               active_branches = b;
+               cur_active_branches++;
+               branch_load_count++;
+       }
 }
 
 static void file_change_m(struct branch *b)
@@ -1746,7 +1765,14 @@ static struct hash_list *cmd_merge(unsigned int *count)
                        if (oe->type != OBJ_COMMIT)
                                die("Mark :%" PRIuMAX " not a commit", idnum);
                        hashcpy(n->sha1, oe->sha1);
-               } else if (get_sha1(from, n->sha1))
+               } else if (!get_sha1(from, n->sha1)) {
+                       unsigned long size;
+                       char *buf = read_object_with_reference(n->sha1,
+                               commit_type, &size, n->sha1);
+                       if (!buf || size < 46)
+                               die("Not a valid commit: %s", from);
+                       free(buf);
+               } else
                        die("Invalid ref name or SHA1 expression: %s", from);
 
                n->next = NULL;
@@ -1967,6 +1993,40 @@ static void cmd_checkpoint(void)
        read_next_command();
 }
 
+static void import_marks(const char *input_file)
+{
+       char line[512];
+       FILE *f = fopen(input_file, "r");
+       if (!f)
+               die("cannot read %s: %s", input_file, strerror(errno));
+       while (fgets(line, sizeof(line), f)) {
+               uintmax_t mark;
+               char *end;
+               unsigned char sha1[20];
+               struct object_entry *e;
+
+               end = strchr(line, '\n');
+               if (line[0] != ':' || !end)
+                       die("corrupt mark line: %s", line);
+               *end = 0;
+               mark = strtoumax(line + 1, &end, 10);
+               if (!mark || end == line + 1
+                       || *end != ' ' || get_sha1(end + 1, sha1))
+                       die("corrupt mark line: %s", line);
+               e = find_object(sha1);
+               if (!e) {
+                       enum object_type type = sha1_object_info(sha1, NULL);
+                       if (type < 0)
+                               die("object not found: %s", sha1_to_hex(sha1));
+                       e = insert_object(sha1);
+                       e->type = type;
+                       e->pack_id = MAX_PACK_ID;
+               }
+               insert_mark(mark, e);
+       }
+       fclose(f);
+}
+
 static const char fast_import_usage[] =
 "git-fast-import [--date-format=f] [--max-pack-size=n] [--depth=n] [--active-branches=n] [--export-marks=marks.file]";
 
@@ -1975,6 +2035,12 @@ int main(int argc, const char **argv)
        int i, show_stats = 1;
 
        git_config(git_default_config);
+       alloc_objects(object_entry_alloc);
+       strbuf_init(&command_buf);
+       atom_table = xcalloc(atom_table_sz, sizeof(struct atom_str*));
+       branch_table = xcalloc(branch_table_sz, sizeof(struct branch*));
+       avail_tree_table = xcalloc(avail_tree_table_sz, sizeof(struct avail_tree_content*));
+       marks = pool_calloc(1, sizeof(struct mark_set));
 
        for (i = 1; i < argc; i++) {
                const char *a = argv[i];
@@ -1998,6 +2064,8 @@ int main(int argc, const char **argv)
                        max_depth = strtoul(a + 8, NULL, 0);
                else if (!prefixcmp(a, "--active-branches="))
                        max_active_branches = strtoul(a + 18, NULL, 0);
+               else if (!prefixcmp(a, "--import-marks="))
+                       import_marks(a + 15);
                else if (!prefixcmp(a, "--export-marks="))
                        mark_file = a + 15;
                else if (!prefixcmp(a, "--export-pack-edges=")) {
@@ -2018,14 +2086,6 @@ int main(int argc, const char **argv)
        if (i != argc)
                usage(fast_import_usage);
 
-       alloc_objects(object_entry_alloc);
-       strbuf_init(&command_buf);
-
-       atom_table = xcalloc(atom_table_sz, sizeof(struct atom_str*));
-       branch_table = xcalloc(branch_table_sz, sizeof(struct branch*));
-       avail_tree_table = xcalloc(avail_tree_table_sz, sizeof(struct avail_tree_content*));
-       marks = pool_calloc(1, sizeof(struct mark_set));
-
        start_packfile();
        for (;;) {
                read_next_command();
index 41bdd27b8fce5dd0656b9dcc71e6768f0b4796c6..06f4aeced439312c43f2736a1684f9e22218899b 100644 (file)
@@ -15,8 +15,9 @@ static int quiet;
 static int verbose;
 static int fetch_all;
 static int depth;
+static int no_progress;
 static const char fetch_pack_usage[] =
-"git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--upload-pack=<git-upload-pack>] [--depth=<n>] [-v] [<host>:]<directory> [<refs>...]";
+"git-fetch-pack [--all] [--quiet|-q] [--keep|-k] [--thin] [--upload-pack=<git-upload-pack>] [--depth=<n>] [--no-progress] [-v] [<host>:]<directory> [<refs>...]";
 static const char *uploadpack = "git-upload-pack";
 
 #define COMPLETE       (1U << 0)
@@ -173,12 +174,13 @@ static int find_common(int fd[2], unsigned char *result_sha1,
                }
 
                if (!fetching)
-                       packet_write(fd[1], "want %s%s%s%s%s%s\n",
+                       packet_write(fd[1], "want %s%s%s%s%s%s%s\n",
                                     sha1_to_hex(remote),
                                     (multi_ack ? " multi_ack" : ""),
                                     (use_sideband == 2 ? " side-band-64k" : ""),
                                     (use_sideband == 1 ? " side-band" : ""),
                                     (use_thin_pack ? " thin-pack" : ""),
+                                    (no_progress ? " no-progress" : ""),
                                     " ofs-delta");
                else
                        packet_write(fd[1], "want %s\n", sha1_to_hex(remote));
@@ -521,7 +523,7 @@ static int get_pack(int xd[2])
        if (do_keep) {
                *av++ = "index-pack";
                *av++ = "--stdin";
-               if (!quiet)
+               if (!quiet && !no_progress)
                        *av++ = "-v";
                if (use_thin_pack)
                        *av++ = "--fix-thin";
@@ -718,6 +720,10 @@ int main(int argc, char **argv)
                                        st.st_mtime = 0;
                                continue;
                        }
+                       if (!strcmp("--no-progress", arg)) {
+                               no_progress = 1;
+                               continue;
+                       }
                        usage(fetch_pack_usage);
                }
                dest = arg;
index 0fcb156d14298e23658b6f495d7ed201b260834e..c1e7c1ddcbbf45995b53785a0f39314f6d499d2c 100755 (executable)
@@ -89,7 +89,11 @@ END
 # values associated with keys:
 #   =1 - Arch version / git 'branch' detected via abrowse on a limit
 #   >1 - Arch version / git 'branch' of an auxiliary branch we've merged
-my %arch_branches = map { $_ => 1 } @ARGV;
+my %arch_branches = map { my $branch = $_; $branch =~ s/:[^:]*$//; $branch => 1 } @ARGV;
+
+# $branch_name_map:
+# maps arch branches to git branch names
+my %branch_name_map = map { m/^(.*):([^:]*)$/; $1 => $2 } grep { m/:/ } @ARGV;
 
 $ENV{'TMPDIR'} = $opt_t if $opt_t; # $ENV{TMPDIR} will affect tempdir() calls:
 my $tmp = tempdir('git-archimport-XXXXXX', TMPDIR => 1, CLEANUP => 1);
@@ -104,6 +108,7 @@ END
     closedir DIR
 }
 
+my $default_archive;           # default Arch archive
 my %reachable = ();             # Arch repositories we can access
 my %unreachable = ();           # Arch repositories we can't access :<
 my @psets  = ();                # the collection
@@ -303,7 +308,34 @@ sub old_style_branchname {
     return $ret;
 }
 
-*git_branchname = $opt_o ? *old_style_branchname : *tree_dirname;
+*git_default_branchname = $opt_o ? *old_style_branchname : *tree_dirname;
+
+# retrieve default archive, since $branch_name_map keys might not include it
+sub get_default_archive {
+    if (!defined $default_archive) {
+        $default_archive = safe_pipe_capture($TLA,'my-default-archive');
+        chomp $default_archive;
+    }
+    return $default_archive;
+}
+
+sub git_branchname {
+    my $revision = shift;
+    my $name = extract_versionname($revision);
+
+    if (exists $branch_name_map{$name}) {
+       return $branch_name_map{$name};
+
+    } elsif ($name =~ m#^([^/]*)/(.*)$#
+            && $1 eq get_default_archive()
+            && exists $branch_name_map{$2}) {
+       # the names given in the command-line lacked the archive.
+       return $branch_name_map{$2};
+
+    } else {
+       return git_default_branchname($revision);
+    }
+}
 
 sub process_patchset_accurate {
     my $ps = shift;
@@ -333,19 +365,23 @@ sub process_patchset_accurate {
         if ($ps->{tag} && (my $branchpoint = eval { ptag($ps->{tag}) })) {
             
             # find where we are supposed to branch from
-            system('git-checkout','-f','-b',$ps->{branch},
-                            $branchpoint) == 0 or die "$! $?\n";
-            
+           if (! -e "$git_dir/refs/heads/$ps->{branch}") {
+               system('git-branch',$ps->{branch},$branchpoint) == 0 or die "$! $?\n";
+
+               # We trust Arch with the fact that this is just a tag,
+               # and it does not affect the state of the tree, so
+               # we just tag and move on.  If the user really wants us
+               # to consolidate more branches into one, don't tag because
+               # the tag name would be already taken.
+               tag($ps->{id}, $branchpoint);
+               ptag($ps->{id}, $branchpoint);
+               print " * Tagged $ps->{id} at $branchpoint\n";
+           }
+           system('git-checkout','-f',$ps->{branch}) == 0 or die "$! $?\n";
+
             # remove any old stuff that got leftover:
             my $rm = safe_pipe_capture('git-ls-files','--others','-z');
             rmtree(split(/\0/,$rm)) if $rm;
-
-            # If we trust Arch with the fact that this is just 
-            # a tag, and it does not affect the state of the tree
-            # then we just tag and move on
-            tag($ps->{id}, $branchpoint);
-            ptag($ps->{id}, $branchpoint);
-            print " * Tagged $ps->{id} at $branchpoint\n";
             return 0;
         } else {
             warn "Tagging from unknown id unsupported\n" if $ps->{tag};
@@ -385,14 +421,19 @@ sub process_patchset_fast {
                 unless $branchpoint;
             
             # find where we are supposed to branch from
-            system('git-checkout','-b',$ps->{branch},$branchpoint);
-
-            # If we trust Arch with the fact that this is just 
-            # a tag, and it does not affect the state of the tree
-            # then we just tag and move on
-            tag($ps->{id}, $branchpoint);
-            ptag($ps->{id}, $branchpoint);
-            print " * Tagged $ps->{id} at $branchpoint\n";
+           if (! -e "$git_dir/refs/heads/$ps->{branch}") {
+               system('git-branch',$ps->{branch},$branchpoint) == 0 or die "$! $?\n";
+
+               # We trust Arch with the fact that this is just a tag,
+               # and it does not affect the state of the tree, so
+               # we just tag and move on.  If the user really wants us
+               # to consolidate more branches into one, don't tag because
+               # the tag name would be already taken.
+               tag($ps->{id}, $branchpoint);
+               ptag($ps->{id}, $branchpoint);
+               print " * Tagged $ps->{id} at $branchpoint\n";
+            }
+            system('git-checkout',$ps->{branch}) == 0 or die "$! $?\n";
             return 0;
         } 
         die $! if $?;
@@ -830,8 +871,9 @@ sub tag {
     if ($opt_o) {
         $tag =~ s|/|--|g;
     } else {
-        # don't use subdirs for tags yet, it could screw up other porcelains
-        $tag =~ s|/|,|g;
+       my $patchname = $tag;
+       $patchname =~ s/.*--//;
+        $tag = git_branchname ($tag) . '--' . $patchname;
     }
     
     if ($commit) {
index 1bd54ded3c424db30ca46b00b3ed42b4d774d21d..de51983584bb0fd015ed75704b72bec8fdb55430 100755 (executable)
@@ -79,6 +79,8 @@ origin=
 origin_override=
 use_separate_remote=t
 depth=
+no_progress=
+test -t 1 || no_progress=--no-progress
 while
        case "$#,$1" in
        0,*) break ;;
@@ -290,8 +292,8 @@ yes,yes)
                ;;
        *)
                case "$upload_pack" in
-               '') git-fetch-pack --all -k $quiet $depth "$repo" ;;
-               *) git-fetch-pack --all -k $quiet "$upload_pack" $depth "$repo" ;;
+               '') git-fetch-pack --all -k $quiet $depth $no_progress "$repo";;
+               *) git-fetch-pack --all -k $quiet "$upload_pack" $depth $no_progress "$repo" ;;
                esac >"$GIT_DIR/CLONE_HEAD" ||
                        die "fetch-pack from '$repo' failed."
                ;;
@@ -393,7 +395,7 @@ then
 
        case "$no_checkout" in
        '')
-               test "z$quiet" = z && v=-v || v=
+               test "z$quiet" = z -a "z$no_progress" = z && v=-v || v=
                git-read-tree -m -u $v HEAD HEAD
        esac
 fi
index be3677c2049dca4deb35403804d5ea2d72254e7d..b8c00b823656f36f6a6f38493b9569831db713b1 100755 (executable)
@@ -622,6 +622,9 @@ else
 fi
 ret="$?"
 rm -f "$GIT_DIR/COMMIT_MSG" "$GIT_DIR/COMMIT_EDITMSG" "$GIT_DIR/SQUASH_MSG"
+
+cd_to_toplevel
+
 if test -d "$GIT_DIR/rr-cache"
 then
        git-rerere
index 56212b2f115d0ef738c5835c42d7bf241db4576a..7534db1267bfa64a4a0cba80680fefc42177f0e8 100644 (file)
 #define PATH_MAX 4096
 #endif
 
+#ifndef PRIuMAX
+#define PRIuMAX "llu"
+#endif
+
 #ifdef __GNUC__
 #define NORETURN __attribute__((__noreturn__))
 #else
@@ -254,6 +258,11 @@ static inline ssize_t xwrite(int fd, const void *buf, size_t len)
        }
 }
 
+static inline size_t xsize_t(off_t len)
+{
+       return (size_t)len;
+}
+
 static inline int has_extension(const char *filename, const char *ext)
 {
        size_t len = strlen(filename);
index 59bee5db0f0738cd6d43772e7279edf726a0b7d1..5ae0d28cc09a0b3935262a542c9811b66eb5b85e 100755 (executable)
@@ -24,6 +24,8 @@ update_head_ok=
 exec=
 keep=
 shallow_depth=
+no_progress=
+test -t 1 || no_progress=--no-progress
 while case "$#" in 0) break ;; esac
 do
        case "$1" in
@@ -392,7 +394,8 @@ fetch_main () {
            git-bundle unbundle "$remote" $rref ||
            echo failed "$remote"
        else
-         git-fetch-pack --thin $exec $keep $shallow_depth "$remote" $rref ||
+         git-fetch-pack --thin $exec $keep $shallow_depth $no_progress \
+               "$remote" $rref ||
          echo failed "$remote"
        fi
       ) |
index 66538ba1adb9d50b80288f9ae3c0df77758059aa..e486e8f9843ed48f06e667cfa5659e51e5a0e4d1 100644 (file)
@@ -1,5 +1,8 @@
 all::
 
+# Define V=1 to have a more verbose compile.
+#
+
 GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
        @$(SHELL_PATH) ./GIT-VERSION-GEN
 -include GIT-VERSION-FILE
@@ -19,27 +22,32 @@ ifndef INSTALL
        INSTALL = install
 endif
 
+ifndef V
+       QUIET_GEN      = @echo '   ' GEN $@;
+       QUIET_BUILT_IN = @echo '   ' BUILTIN $@;
+endif
+
 DESTDIR_SQ = $(subst ','\'',$(DESTDIR))
 gitexecdir_SQ = $(subst ','\'',$(gitexecdir))
 SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
 
 git-gui: git-gui.sh GIT-VERSION-FILE CREDITS-FILE
-       rm -f $@ $@+
+       $(QUIET_GEN)rm -f $@ $@+ && \
        sed -n \
                -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
                -e 's/@@GITGUI_VERSION@@/$(GITGUI_VERSION)/g' \
                -e '1,/^set gitgui_credits /p' \
-               $@.sh >$@+
-       cat CREDITS-FILE >>$@+
-       sed -e '1,/^set gitgui_credits /d' $@.sh >>$@+
-       chmod +x $@+
+               $@.sh >$@+ && \
+       cat CREDITS-FILE >>$@+ && \
+       sed -e '1,/^set gitgui_credits /d' $@.sh >>$@+ && \
+       chmod +x $@+ && \
        mv $@+ $@
 
 CREDITS-FILE: CREDITS-GEN .FORCE-CREDITS-FILE
-       $(SHELL_PATH) ./CREDITS-GEN
+       $(QUIET_GEN)$(SHELL_PATH) ./CREDITS-GEN
 
 $(GITGUI_BUILT_INS): git-gui
-       rm -f $@ && ln git-gui $@
+       $(QUIET_BUILT_IN)rm -f $@ && ln git-gui $@
 
 all:: $(ALL_PROGRAMS)
 
index f84ba3382b3078ee6de45bddfacd650973068303..1981827a8e8bcc2b2e43598bb06e3e6c87bd4d1d 100755 (executable)
@@ -1267,6 +1267,24 @@ proc commit_committree {fd_wt curHEAD msg} {
                return
        }
 
+       # -- Verify this wasn't an empty change.
+       #
+       if {$commit_type eq {normal}} {
+               set old_tree [git rev-parse "$PARENT^{tree}"]
+               if {$tree_id eq $old_tree} {
+                       info_popup {No changes to commit.
+
+No files were modified by this commit and it
+was not a merge commit.
+
+A rescan will be automatically started now.
+}
+                       unlock_index
+                       rescan {set ui_status_value {No changes to commit.}}
+                       return
+               }
+       }
+
        # -- Build the message.
        #
        set msg_p [gitdir COMMIT_EDITMSG]
@@ -1281,14 +1299,8 @@ proc commit_committree {fd_wt curHEAD msg} {
        # -- Create the commit.
        #
        set cmd [list git commit-tree $tree_id]
-       set parents [concat $PARENT $MERGE_HEAD]
-       if {[llength $parents] > 0} {
-               foreach p $parents {
-                       lappend cmd -p $p
-               }
-       } else {
-               # git commit-tree writes to stderr during initial commit.
-               lappend cmd 2>/dev/null
+       foreach p [concat $PARENT $MERGE_HEAD] {
+               lappend cmd -p $p
        }
        lappend cmd <$msg_p
        if {[catch {set cmt_id [eval exec $cmd]} err]} {
@@ -5256,6 +5268,12 @@ if {[is_enabled branch]} {
                -font font_ui
        lappend disable_on_lock [list .mbar.branch entryconf \
                [.mbar.branch index last] -state]
+
+       .mbar.branch add command -label {Reset...} \
+               -command do_reset_hard \
+               -font font_ui
+       lappend disable_on_lock [list .mbar.branch entryconf \
+               [.mbar.branch index last] -state]
 }
 
 # -- Commit Menu
@@ -5330,6 +5348,34 @@ if {[is_enabled multicommit] || [is_enabled singlecommit]} {
                [list .mbar.commit entryconf [.mbar.commit index last] -state]
 }
 
+# -- Merge Menu
+#
+if {[is_enabled branch]} {
+       menu .mbar.merge
+       .mbar.merge add command -label {Local Merge...} \
+               -command do_local_merge \
+               -font font_ui
+       lappend disable_on_lock \
+               [list .mbar.merge entryconf [.mbar.merge index last] -state]
+       .mbar.merge add command -label {Abort Merge...} \
+               -command do_reset_hard \
+               -font font_ui
+       lappend disable_on_lock \
+               [list .mbar.merge entryconf [.mbar.merge index last] -state]
+
+}
+
+# -- Transport Menu
+#
+if {[is_enabled transport]} {
+       menu .mbar.fetch
+
+       menu .mbar.push
+       .mbar.push add command -label {Push...} \
+               -command do_push_anywhere \
+               -font font_ui
+}
+
 if {[is_MacOSX]} {
        # -- Apple Menu (Mac OS X only)
        #
@@ -5502,28 +5548,6 @@ pack .branch.l1 -side left
 pack .branch.cb -side left -fill x
 pack .branch -side top -fill x
 
-if {[is_enabled branch]} {
-       menu .mbar.merge
-       .mbar.merge add command -label {Local Merge...} \
-               -command do_local_merge \
-               -font font_ui
-       lappend disable_on_lock \
-               [list .mbar.merge entryconf [.mbar.merge index last] -state]
-       .mbar.merge add command -label {Abort Merge...} \
-               -command do_reset_hard \
-               -font font_ui
-       lappend disable_on_lock \
-               [list .mbar.merge entryconf [.mbar.merge index last] -state]
-
-
-       menu .mbar.fetch
-
-       menu .mbar.push
-       .mbar.push add command -label {Push...} \
-               -command do_push_anywhere \
-               -font font_ui
-}
-
 # -- Main Window Layout
 #
 panedwindow .vpane -orient vertical
index 41961b59f6d7848efbb4e7b91dcb629bbd7d4abb..326e89fe037561c1ad72d91c7783bf2a0f603826 100755 (executable)
@@ -447,7 +447,7 @@ sub cmd_show_ignore {
        my $url = (::working_head_info('HEAD'))[0];
        my $gs = Git::SVN->find_by_url($url) || Git::SVN->new;
        my $r = (defined $_revision ? $_revision : $gs->ra->get_latest_revnum);
-       $gs->traverse_ignore(\*STDOUT, '', $r);
+       $gs->traverse_ignore(\*STDOUT, $gs->{path}, $r);
 }
 
 sub cmd_multi_init {
@@ -1334,7 +1334,7 @@ sub traverse_ignore {
        my $ra = $self->ra;
        my ($dirent, undef, $props) = $ra->get_dir($path, $r);
        my $p = $path;
-       $p =~ s#^\Q$ra->{svn_path}\E/##;
+       $p =~ s#^\Q$self->{path}\E(/|$)##;
        print $fh length $p ? "\n# $p\n" : "\n# /\n";
        if (my $s = $props->{'svn:ignore'}) {
                $s =~ s/[\r\n]+/\n/g;
index 653ca3cc60ef161f06bd3a6652eba7ad3453cc2e..27b5970bcadf21f2f0e294c8c34d9595f6288503 100755 (executable)
@@ -591,7 +591,7 @@ ($;%)
        my %opts = @_;
 
        $str = to_utf8($str);
-       $str = escapeHTML($str);
+       $str = $cgi->escapeHTML($str);
        if ($opts{'-nbsp'}) {
                $str =~ s/ /&nbsp;/g;
        }
@@ -605,7 +605,7 @@ sub esc_path {
        my %opts = @_;
 
        $str = to_utf8($str);
-       $str = escapeHTML($str);
+       $str = $cgi->escapeHTML($str);
        if ($opts{'-nbsp'}) {
                $str =~ s/ /&nbsp;/g;
        }
@@ -1974,17 +1974,17 @@ sub git_print_page_path {
                        $fullname .= ($fullname ? '/' : '') . $dir;
                        print $cgi->a({-href => href(action=>"tree", file_name=>$fullname,
                                                     hash_base=>$hb),
-                                     -title => esc_html($fullname)}, esc_path($dir));
+                                     -title => $fullname}, esc_path($dir));
                        print " / ";
                }
                if (defined $type && $type eq 'blob') {
                        print $cgi->a({-href => href(action=>"blob_plain", file_name=>$file_name,
                                                     hash_base=>$hb),
-                                     -title => esc_html($name)}, esc_path($basename));
+                                     -title => $name}, esc_path($basename));
                } elsif (defined $type && $type eq 'tree') {
                        print $cgi->a({-href => href(action=>"tree", file_name=>$file_name,
                                                     hash_base=>$hb),
-                                     -title => esc_html($name)}, esc_path($basename));
+                                     -title => $name}, esc_path($basename));
                        print " / ";
                } else {
                        print esc_path($basename);
index cf81a99500e9bf5fc0c0812a2172c5561dc65b68..b405864be954941dedc4b0cc0c7f7aefcf65dd2d 100644 (file)
@@ -753,7 +753,7 @@ static void final(const char *final_pack_name, const char *curr_pack_name,
                  const char *keep_name, const char *keep_msg,
                  unsigned char *sha1)
 {
-       char *report = "pack";
+       const char *report = "pack";
        char name[PATH_MAX];
        int err;
 
index f992ef77533737fe2ec52dc3b662cb6cacca0ea2..fb30694f4741147bba62350f704111d3afbf8133 100644 (file)
@@ -55,7 +55,7 @@ int interpolate(char *result, int reslen,
        const char *src = orig;
        char *dest = result;
        int newlen = 0;
-       char *name, *value;
+       const char *name, *value;
        int namelen, valuelen;
        int i;
        char c;
index 190a180b587aa565ae2ae71f9eb068ad75db168f..16a26b998699a8a5a5b3472f4b57a574a292beef 100644 (file)
@@ -12,7 +12,7 @@
  */
 
 struct interp {
-       char *name;
+       const char *name;
        char *value;
 };
 
index 87cd8709bbc99db559f3892c048ec111673a2566..c96e1a734cb0c258cd4adb4f00e247abdf804640 100644 (file)
@@ -570,7 +570,7 @@ static void update_file_flags(const unsigned char *sha,
                if (type != OBJ_BLOB)
                        die("blob expected for %s '%s'", sha1_to_hex(sha), path);
 
-               if (S_ISREG(mode)) {
+               if (S_ISREG(mode) || (!has_symlinks && S_ISLNK(mode))) {
                        int fd;
                        if (mkdir_p(path, 0777))
                                die("failed to create path %s: %s", path, strerror(errno));
@@ -591,6 +591,7 @@ static void update_file_flags(const unsigned char *sha,
                        mkdir_p(path, 0777);
                        unlink(path);
                        symlink(lnk, path);
+                       free(lnk);
                } else
                        die("do not know what to do with %06o %s '%s'",
                            mode, sha1_to_hex(sha), path);
index f248ac8c7aa0efb976528e5f7941fef1f6b5bc91..299c514128b8b6330561a1a2b8ac30324a7ac479 100644 (file)
@@ -4,12 +4,13 @@
 static int verify_packfile(struct packed_git *p,
                struct pack_window **w_curs)
 {
-       unsigned long index_size = p->index_size;
+       off_t index_size = p->index_size;
        void *index_base = p->index_base;
        SHA_CTX ctx;
        unsigned char sha1[20];
-       unsigned long offset = 0, pack_sig = p->pack_size - 20;
-       int nr_objects, err, i;
+       off_t offset = 0, pack_sig = p->pack_size - 20;
+       uint32_t nr_objects, i;
+       int err;
 
        /* Note that the pack header checks are actually performed by
         * use_pack when it first opens the pack file.  If anything
@@ -23,7 +24,7 @@ static int verify_packfile(struct packed_git *p,
                unsigned char *in = use_pack(p, w_curs, offset, &remaining);
                offset += remaining;
                if (offset > pack_sig)
-                       remaining -= offset - pack_sig;
+                       remaining -= (unsigned int)(offset - pack_sig);
                SHA1_Update(&ctx, in, remaining);
        }
        SHA1_Final(sha1, &ctx);
@@ -40,11 +41,12 @@ static int verify_packfile(struct packed_git *p,
         * we do not do scan-streaming check on the pack file.
         */
        nr_objects = num_packed_objects(p);
-       for (i = err = 0; i < nr_objects; i++) {
+       for (i = 0, err = 0; i < nr_objects; i++) {
                unsigned char sha1[20];
                void *data;
                enum object_type type;
-               unsigned long size, offset;
+               unsigned long size;
+               off_t offset;
 
                if (nth_packed_object_sha1(p, i, sha1))
                        die("internal error pack-check nth-packed-object");
@@ -74,8 +76,7 @@ static int verify_packfile(struct packed_git *p,
 
 static void show_pack_info(struct packed_git *p)
 {
-       int nr_objects, i;
-       unsigned int chain_histogram[MAX_CHAIN];
+       uint32_t nr_objects, i, chain_histogram[MAX_CHAIN];
 
        nr_objects = num_packed_objects(p);
        memset(chain_histogram, 0, sizeof(chain_histogram));
@@ -85,7 +86,7 @@ static void show_pack_info(struct packed_git *p)
                const char *type;
                unsigned long size;
                unsigned long store_size;
-               unsigned long offset;
+               off_t offset;
                unsigned int delta_chain_length;
 
                if (nth_packed_object_sha1(p, i, sha1))
@@ -99,9 +100,11 @@ static void show_pack_info(struct packed_git *p)
                                                 base_sha1);
                printf("%s ", sha1_to_hex(sha1));
                if (!delta_chain_length)
-                       printf("%-6s %lu %lu\n", type, size, offset);
+                       printf("%-6s %lu %"PRIuMAX"\n",
+                              type, size, (uintmax_t)offset);
                else {
-                       printf("%-6s %lu %lu %u %s\n", type, size, offset,
+                       printf("%-6s %lu %"PRIuMAX" %u %s\n",
+                              type, size, (uintmax_t)offset,
                               delta_chain_length, sha1_to_hex(base_sha1));
                        if (delta_chain_length < MAX_CHAIN)
                                chain_histogram[delta_chain_length]++;
@@ -123,7 +126,7 @@ static void show_pack_info(struct packed_git *p)
 
 int verify_pack(struct packed_git *p, int verbose)
 {
-       unsigned long index_size = p->index_size;
+       off_t index_size = p->index_size;
        void *index_base = p->index_base;
        SHA_CTX ctx;
        unsigned char sha1[20];
@@ -132,7 +135,7 @@ int verify_pack(struct packed_git *p, int verbose)
        ret = 0;
        /* Verify SHA1 sum of the index file */
        SHA1_Init(&ctx);
-       SHA1_Update(&ctx, index_base, index_size - 20);
+       SHA1_Update(&ctx, index_base, (unsigned int)(index_size - 20));
        SHA1_Final(sha1, &ctx);
        if (hashcmp(sha1, (unsigned char *)index_base + index_size - 20))
                ret = error("Packfile index for %s SHA1 mismatch",
index edb5524fc48b49bca5c0dd319caf348c9bda7c23..c8f7d9af7b502e12a3d36fc3b3e796e43b4f2bdb 100644 (file)
@@ -396,9 +396,9 @@ static size_t get_pack_redundancy(struct pack_list *pl)
        return ret;
 }
 
-static inline size_t pack_set_bytecount(struct pack_list *pl)
+static inline off_t pack_set_bytecount(struct pack_list *pl)
 {
-       size_t ret = 0;
+       off_t ret = 0;
        while (pl) {
                ret += pl->pack->pack_size;
                ret += pl->pack->index_size;
@@ -413,7 +413,7 @@ static void minimize(struct pack_list **min)
                *non_unique = NULL, *min_perm = NULL;
        struct pll *perm, *perm_all, *perm_ok = NULL, *new_perm;
        struct llist *missing;
-       size_t min_perm_size = (size_t)-1, perm_size;
+       off_t min_perm_size = 0, perm_size;
        int n;
 
        pl = local_packs;
@@ -461,7 +461,7 @@ static void minimize(struct pack_list **min)
        perm = perm_ok;
        while (perm) {
                perm_size = pack_set_bytecount(perm->pl);
-               if (min_perm_size > perm_size) {
+               if (!min_perm_size || min_perm_size > perm_size) {
                        min_perm_size = perm_size;
                        min_perm = perm->pl;
                }
diff --git a/path.c b/path.c
index c5d25a4b903bd92930df4004d30d4dffa6054456..6395cf23098841c16d993ae7e86b2d8dcff01cd7 100644 (file)
--- a/path.c
+++ b/path.c
@@ -252,7 +252,7 @@ char *enter_repo(char *path, int strict)
 
        if (access("objects", X_OK) == 0 && access("refs", X_OK) == 0 &&
            validate_headref("HEAD") == 0) {
-               putenv("GIT_DIR=.");
+               setenv("GIT_DIR", ".", 1);
                check_repository_format();
                return path;
        }
index 7a104e351263ee47dc51bcca2ce2761fbd7f5092..6339a278da1ae1b323b5abf7d2604c7afdfde4e4 100644 (file)
@@ -66,7 +66,7 @@ static int ce_compare_data(struct cache_entry *ce, struct stat *st)
        return match;
 }
 
-static int ce_compare_link(struct cache_entry *ce, unsigned long expected_size)
+static int ce_compare_link(struct cache_entry *ce, size_t expected_size)
 {
        int match = -1;
        char *target;
@@ -101,7 +101,7 @@ static int ce_modified_check_fs(struct cache_entry *ce, struct stat *st)
                        return DATA_CHANGED;
                break;
        case S_IFLNK:
-               if (ce_compare_link(ce, st->st_size))
+               if (ce_compare_link(ce, xsize_t(st->st_size)))
                        return DATA_CHANGED;
                break;
        default:
@@ -125,7 +125,9 @@ static int ce_match_stat_basic(struct cache_entry *ce, struct stat *st)
                        changed |= MODE_CHANGED;
                break;
        case S_IFLNK:
-               changed |= !S_ISLNK(st->st_mode) ? TYPE_CHANGED : 0;
+               if (!S_ISLNK(st->st_mode) &&
+                   (has_symlinks || !S_ISREG(st->st_mode)))
+                       changed |= TYPE_CHANGED;
                break;
        default:
                die("internal error: ce_mode is %o", ntohl(ce->ce_mode));
@@ -344,11 +346,11 @@ int add_file_to_index(const char *path, int verbose)
        ce->ce_flags = htons(namelen);
        fill_stat_cache_info(ce, &st);
 
-       if (trust_executable_bit)
+       if (trust_executable_bit && has_symlinks)
                ce->ce_mode = create_ce_mode(st.st_mode);
        else {
-               /* If there is an existing entry, pick the mode bits
-                * from it, otherwise assume unexecutable.
+               /* If there is an existing entry, pick the mode bits and type
+                * from it, otherwise assume unexecutable regular file.
                 */
                struct cache_entry *ent;
                int pos = cache_name_pos(path, namelen);
@@ -795,7 +797,7 @@ int read_cache_from(const char *path)
        }
 
        if (!fstat(fd, &st)) {
-               cache_mmap_size = st.st_size;
+               cache_mmap_size = xsize_t(st.st_size);
                errno = EINVAL;
                if (cache_mmap_size >= sizeof(struct cache_header) + 20)
                        cache_mmap = xmmap(NULL, cache_mmap_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
index 7f1dcc045c0818db3d515755e4bf1ae0d82f9647..675c88f4924086667deddc945011f6037ee8a8eb 100644 (file)
@@ -67,18 +67,47 @@ struct command {
 
 static struct command *commands;
 
-static char update_hook[] = "hooks/update";
+static const char update_hook[] = "hooks/update";
+static const char pre_receive_hook[] = "hooks/pre-receive";
+static const char post_receive_hook[] = "hooks/post-receive";
 
-static int run_update_hook(const char *refname,
-                          char *old_hex, char *new_hex)
+static int run_hook(const char *hook_name,
+       struct command *first_cmd,
+       int single)
 {
-       int code;
+       struct command *cmd;
+       int argc, code;
+       const char **argv;
 
-       if (access(update_hook, X_OK) < 0)
+       for (argc = 0, cmd = first_cmd; cmd; cmd = cmd->next) {
+               if (!cmd->error_string)
+                       argc += 3;
+               if (single)
+                       break;
+       }
+
+       if (!argc || access(hook_name, X_OK) < 0)
                return 0;
-       code = run_command_opt(RUN_COMMAND_NO_STDIN
-               | RUN_COMMAND_STDOUT_TO_STDERR,
-               update_hook, refname, old_hex, new_hex, NULL);
+
+       argv = xmalloc(sizeof(*argv) * (2 + argc));
+       argv[0] = hook_name;
+       for (argc = 1, cmd = first_cmd; cmd; cmd = cmd->next) {
+               if (!cmd->error_string) {
+                       argv[argc++] = xstrdup(cmd->ref_name);
+                       argv[argc++] = xstrdup(sha1_to_hex(cmd->old_sha1));
+                       argv[argc++] = xstrdup(sha1_to_hex(cmd->new_sha1));
+               }
+               if (single)
+                       break;
+       }
+       argv[argc] = NULL;
+
+       code = run_command_v_opt(argv,
+               RUN_COMMAND_NO_STDIN | RUN_COMMAND_STDOUT_TO_STDERR);
+       while (--argc > 0)
+               free((char*)argv[argc]);
+       free(argv);
+
        switch (code) {
        case 0:
                return 0;
@@ -91,37 +120,31 @@ static int run_update_hook(const char *refname,
        case -ERR_RUN_COMMAND_WAITPID_WRONG_PID:
                return error("waitpid is confused");
        case -ERR_RUN_COMMAND_WAITPID_SIGNAL:
-               return error("%s died of signal", update_hook);
+               return error("%s died of signal", hook_name);
        case -ERR_RUN_COMMAND_WAITPID_NOEXIT:
-               return error("%s died strangely", update_hook);
+               return error("%s died strangely", hook_name);
        default:
-               error("%s exited with error code %d", update_hook, -code);
+               error("%s exited with error code %d", hook_name, -code);
                return -code;
        }
 }
 
-static int update(struct command *cmd)
+static const char *update(struct command *cmd)
 {
        const char *name = cmd->ref_name;
        unsigned char *old_sha1 = cmd->old_sha1;
        unsigned char *new_sha1 = cmd->new_sha1;
-       char new_hex[41], old_hex[41];
        struct ref_lock *lock;
 
-       cmd->error_string = NULL;
        if (!prefixcmp(name, "refs/") && check_ref_format(name + 5)) {
-               cmd->error_string = "funny refname";
-               return error("refusing to create funny ref '%s' locally",
-                            name);
+               error("refusing to create funny ref '%s' locally", name);
+               return "funny refname";
        }
 
-       strcpy(new_hex, sha1_to_hex(new_sha1));
-       strcpy(old_hex, sha1_to_hex(old_sha1));
-
        if (!is_null_sha1(new_sha1) && !has_sha1_file(new_sha1)) {
-               cmd->error_string = "bad pack";
-               return error("unpack should have generated %s, "
-                            "but I can't find it!", new_hex);
+               error("unpack should have generated %s, "
+                     "but I can't find it!", sha1_to_hex(new_sha1));
+               return "bad pack";
        }
        if (deny_non_fast_forwards && !is_null_sha1(new_sha1) &&
            !is_null_sha1(old_sha1) &&
@@ -136,32 +159,39 @@ static int update(struct command *cmd)
                        if (!hashcmp(old_sha1, ent->item->object.sha1))
                                break;
                free_commit_list(bases);
-               if (!ent)
-                       return error("denying non-fast forward;"
-                                    " you should pull first");
+               if (!ent) {
+                       error("denying non-fast forward %s"
+                             " (you should pull first)", name);
+                       return "non-fast forward";
+               }
        }
-       if (run_update_hook(name, old_hex, new_hex)) {
-               cmd->error_string = "hook declined";
-               return error("hook declined to update %s", name);
+       if (run_hook(update_hook, cmd, 1)) {
+               error("hook declined to update %s", name);
+               return "hook declined";
        }
 
        if (is_null_sha1(new_sha1)) {
                if (delete_ref(name, old_sha1)) {
-                       cmd->error_string = "failed to delete";
-                       return error("failed to delete %s", name);
+                       error("failed to delete %s", name);
+                       return "failed to delete";
                }
-               fprintf(stderr, "%s: %s -> deleted\n", name, old_hex);
+               fprintf(stderr, "%s: %s -> deleted\n", name,
+                       sha1_to_hex(old_sha1));
+               return NULL; /* good */
        }
        else {
                lock = lock_any_ref_for_update(name, old_sha1);
                if (!lock) {
-                       cmd->error_string = "failed to lock";
-                       return error("failed to lock %s", name);
+                       error("failed to lock %s", name);
+                       return "failed to lock";
+               }
+               if (write_ref_sha1(lock, new_sha1, "push")) {
+                       return "failed to write"; /* error() already called */
                }
-               write_ref_sha1(lock, new_sha1, "push");
-               fprintf(stderr, "%s: %s -> %s\n", name, old_hex, new_hex);
+               fprintf(stderr, "%s: %s -> %s\n", name,
+                       sha1_to_hex(old_sha1), sha1_to_hex(new_sha1));
+               return NULL; /* good */
        }
-       return 0;
 }
 
 static char update_post_hook[] = "hooks/post-update";
@@ -172,14 +202,14 @@ static void run_update_post_hook(struct command *cmd)
        int argc;
        const char **argv;
 
-       if (access(update_post_hook, X_OK) < 0)
-               return;
-       for (argc = 1, cmd_p = cmd; cmd_p; cmd_p = cmd_p->next) {
+       for (argc = 0, cmd_p = cmd; cmd_p; cmd_p = cmd_p->next) {
                if (cmd_p->error_string)
                        continue;
                argc++;
        }
-       argv = xmalloc(sizeof(*argv) * (1 + argc));
+       if (!argc || access(update_post_hook, X_OK) < 0)
+               return;
+       argv = xmalloc(sizeof(*argv) * (2 + argc));
        argv[0] = update_post_hook;
 
        for (argc = 1, cmd_p = cmd; cmd_p; cmd_p = cmd_p->next) {
@@ -196,19 +226,30 @@ static void run_update_post_hook(struct command *cmd)
                | RUN_COMMAND_STDOUT_TO_STDERR);
 }
 
-/*
- * This gets called after(if) we've successfully
- * unpacked the data payload.
- */
-static void execute_commands(void)
+static void execute_commands(const char *unpacker_error)
 {
        struct command *cmd = commands;
 
+       if (unpacker_error) {
+               while (cmd) {
+                       cmd->error_string = "n/a (unpacker error)";
+                       cmd = cmd->next;
+               }
+               return;
+       }
+
+       if (run_hook(pre_receive_hook, commands, 0)) {
+               while (cmd) {
+                       cmd->error_string = "pre-receive hook declined";
+                       cmd = cmd->next;
+               }
+               return;
+       }
+
        while (cmd) {
-               update(cmd);
+               cmd->error_string = update(cmd);
                cmd = cmd->next;
        }
-       run_update_post_hook(commands);
 }
 
 static void read_head_info(void)
@@ -244,7 +285,7 @@ static void read_head_info(void)
                hashcpy(cmd->old_sha1, old_sha1);
                hashcpy(cmd->new_sha1, new_sha1);
                memcpy(cmd->ref_name, line + 82, len - 81);
-               cmd->error_string = "n/a (unpacker error)";
+               cmd->error_string = NULL;
                cmd->next = NULL;
                *p = cmd;
                p = &cmd->next;
@@ -447,12 +488,13 @@ int main(int argc, char **argv)
 
                if (!delete_only(commands))
                        unpack_status = unpack();
-               if (!unpack_status)
-                       execute_commands();
+               execute_commands(unpack_status);
                if (pack_lockfile)
                        unlink(pack_lockfile);
                if (report_status)
                        report(unpack_status);
+               run_hook(post_receive_hook, commands, 0);
+               run_update_post_hook(commands);
        }
        return 0;
 }
diff --git a/refs.c b/refs.c
index 7a1f89caad17cfb090e683c9888537666e8398b9..76c08d03602554a77fcf48a488b0d7fceb41073c 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -1075,6 +1075,7 @@ int read_ref_at(const char *ref, unsigned long at_time, int cnt, unsigned char *
        unsigned long date;
        unsigned char logged_sha1[20];
        void *log_mapped;
+       size_t mapsz;
 
        logfile = git_path("logs/%s", ref);
        logfd = open(logfile, O_RDONLY, 0);
@@ -1083,7 +1084,8 @@ int read_ref_at(const char *ref, unsigned long at_time, int cnt, unsigned char *
        fstat(logfd, &st);
        if (!st.st_size)
                die("Log %s is empty.", logfile);
-       log_mapped = xmmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, logfd, 0);
+       mapsz = xsize_t(st.st_size);
+       log_mapped = xmmap(NULL, mapsz, PROT_READ, MAP_PRIVATE, logfd, 0);
        logdata = log_mapped;
        close(logfd);
 
@@ -1136,7 +1138,7 @@ int read_ref_at(const char *ref, unsigned long at_time, int cnt, unsigned char *
                                                logfile, show_rfc2822_date(date, tz));
                                }
                        }
-                       munmap(log_mapped, st.st_size);
+                       munmap(log_mapped, mapsz);
                        return 0;
                }
                lastrec = rec;
@@ -1155,7 +1157,7 @@ int read_ref_at(const char *ref, unsigned long at_time, int cnt, unsigned char *
                die("Log %s is corrupt.", logfile);
        if (msg)
                *msg = ref_msg(logdata, logend);
-       munmap(log_mapped, st.st_size);
+       munmap(log_mapped, mapsz);
 
        if (cutoff_time)
                *cutoff_time = date;
index 6d0a72ed093d353a672129f7e460d0c1015212d7..219a10f403e0c3aa2f8d60ecde5807cf51d1a659 100644 (file)
@@ -349,6 +349,7 @@ static void link_alt_odb_entries(const char *alt, const char *ep, int sep,
 static void read_info_alternates(const char * relative_base, int depth)
 {
        char *map;
+       size_t mapsz;
        struct stat st;
        char path[PATH_MAX];
        int fd;
@@ -361,12 +362,13 @@ static void read_info_alternates(const char * relative_base, int depth)
                close(fd);
                return;
        }
-       map = xmmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+       mapsz = xsize_t(st.st_size);
+       map = xmmap(NULL, mapsz, PROT_READ, MAP_PRIVATE, fd, 0);
        close(fd);
 
-       link_alt_odb_entries(map, map + st.st_size, '\n', relative_base, depth);
+       link_alt_odb_entries(map, map + mapsz, '\n', relative_base, depth);
 
-       munmap(map, st.st_size);
+       munmap(map, mapsz);
 }
 
 void prepare_alt_odb(void)
@@ -430,13 +432,14 @@ void pack_report()
                pack_mapped, peak_pack_mapped);
 }
 
-static int check_packed_git_idx(const char *path, unsigned long *idx_size_,
-                               void **idx_map_)
+static int check_packed_git_idx(const char *path,
+       unsigned long *idx_size_,
+       void **idx_map_)
 {
        void *idx_map;
        uint32_t *index;
-       unsigned long idx_size;
-       int nr, i;
+       size_t idx_size;
+       uint32_t nr, i;
        int fd = open(path, O_RDONLY);
        struct stat st;
        if (fd < 0)
@@ -445,7 +448,11 @@ static int check_packed_git_idx(const char *path, unsigned long *idx_size_,
                close(fd);
                return -1;
        }
-       idx_size = st.st_size;
+       idx_size = xsize_t(st.st_size);
+       if (idx_size < 4 * 256 + 20 + 20) {
+               close(fd);
+               return error("index file %s is too small", path);
+       }
        idx_map = xmmap(NULL, idx_size, PROT_READ, MAP_PRIVATE, fd, 0);
        close(fd);
 
@@ -453,25 +460,25 @@ static int check_packed_git_idx(const char *path, unsigned long *idx_size_,
        *idx_map_ = idx_map;
        *idx_size_ = idx_size;
 
-       /* check index map */
-       if (idx_size < 4*256 + 20 + 20)
-               return error("index file %s is too small", path);
-
        /* a future index format would start with this, as older git
         * binaries would fail the non-monotonic index check below.
         * give a nicer warning to the user if we can.
         */
-       if (index[0] == htonl(PACK_IDX_SIGNATURE))
+       if (index[0] == htonl(PACK_IDX_SIGNATURE)) {
+               munmap(idx_map, idx_size);
                return error("index file %s is a newer version"
                        " and is not supported by this binary"
                        " (try upgrading GIT to a newer version)",
                        path);
+       }
 
        nr = 0;
        for (i = 0; i < 256; i++) {
-               unsigned int n = ntohl(index[i]);
-               if (n < nr)
+               uint32_t n = ntohl(index[i]);
+               if (n < nr) {
+                       munmap(idx_map, idx_size);
                        return error("non-monotonic index %s", path);
+               }
                nr = n;
        }
 
@@ -482,8 +489,10 @@ static int check_packed_git_idx(const char *path, unsigned long *idx_size_,
         *  - 20-byte SHA1 of the packfile
         *  - 20-byte SHA1 file checksum
         */
-       if (idx_size != 4*256 + nr * 24 + 20 + 20)
+       if (idx_size != 4*256 + nr * 24 + 20 + 20) {
+               munmap(idx_map, idx_size);
                return error("wrong index file size in %s", path);
+       }
 
        return 0;
 }
@@ -622,7 +631,7 @@ static int open_packed_git(struct packed_git *p)
        return -1;
 }
 
-static int in_window(struct pack_window *win, unsigned long offset)
+static int in_window(struct pack_window *win, off_t offset)
 {
        /* We must promise at least 20 bytes (one hash) after the
         * offset is available from this window, otherwise the offset
@@ -637,7 +646,7 @@ static int in_window(struct pack_window *win, unsigned long offset)
 
 unsigned char* use_pack(struct packed_git *p,
                struct pack_window **w_cursor,
-               unsigned long offset,
+               off_t offset,
                unsigned int *left)
 {
        struct pack_window *win = *w_cursor;
@@ -662,11 +671,13 @@ unsigned char* use_pack(struct packed_git *p,
                }
                if (!win) {
                        size_t window_align = packed_git_window_size / 2;
+                       off_t len;
                        win = xcalloc(1, sizeof(*win));
                        win->offset = (offset / window_align) * window_align;
-                       win->len = p->pack_size - win->offset;
-                       if (win->len > packed_git_window_size)
-                               win->len = packed_git_window_size;
+                       len = p->pack_size - win->offset;
+                       if (len > packed_git_window_size)
+                               len = packed_git_window_size;
+                       win->len = (size_t)len;
                        pack_mapped += win->len;
                        while (packed_git_limit < pack_mapped
                                && unuse_one_window(p))
@@ -695,7 +706,7 @@ unsigned char* use_pack(struct packed_git *p,
        }
        offset -= win->offset;
        if (left)
-               *left = win->len - offset;
+               *left = win->len - xsize_t(offset);
        return win->base + offset;
 }
 
@@ -871,9 +882,9 @@ void *map_sha1_file(const unsigned char *sha1, unsigned long *size)
                 */
                sha1_file_open_flag = 0;
        }
-       map = xmmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
+       *size = xsize_t(st.st_size);
+       map = xmmap(NULL, *size, PROT_READ, MAP_PRIVATE, fd, 0);
        close(fd);
-       *size = st.st_size;
        return map;
 }
 
@@ -1042,14 +1053,14 @@ void * unpack_sha1_file(void *map, unsigned long mapsize, enum object_type *type
        return unpack_sha1_rest(&stream, hdr, *size);
 }
 
-static unsigned long get_delta_base(struct packed_git *p,
+static off_t get_delta_base(struct packed_git *p,
                                    struct pack_window **w_curs,
-                                   unsigned long *curpos,
+                                   off_t *curpos,
                                    enum object_type type,
-                                   unsigned long delta_obj_offset)
+                                   off_t delta_obj_offset)
 {
        unsigned char *base_info = use_pack(p, w_curs, *curpos, NULL);
-       unsigned long base_offset;
+       off_t base_offset;
 
        /* use_pack() assured us we have [base_info, base_info + 20)
         * as a range that we can look at without walking off the
@@ -1085,17 +1096,17 @@ static unsigned long get_delta_base(struct packed_git *p,
 }
 
 /* forward declaration for a mutually recursive function */
-static int packed_object_info(struct packed_git *p, unsigned long offset,
+static int packed_object_info(struct packed_git *p, off_t offset,
                              unsigned long *sizep);
 
 static int packed_delta_info(struct packed_git *p,
                             struct pack_window **w_curs,
-                            unsigned long curpos,
+                            off_t curpos,
                             enum object_type type,
-                            unsigned long obj_offset,
+                            off_t obj_offset,
                             unsigned long *sizep)
 {
-       unsigned long base_offset;
+       off_t base_offset;
 
        base_offset = get_delta_base(p, w_curs, &curpos, type, obj_offset);
        type = packed_object_info(p, base_offset, NULL);
@@ -1145,7 +1156,7 @@ static int packed_delta_info(struct packed_git *p,
 
 static int unpack_object_header(struct packed_git *p,
                                struct pack_window **w_curs,
-                               unsigned long *curpos,
+                               off_t *curpos,
                                unsigned long *sizep)
 {
        unsigned char *base;
@@ -1169,14 +1180,15 @@ static int unpack_object_header(struct packed_git *p,
 }
 
 const char *packed_object_info_detail(struct packed_git *p,
-                                     unsigned long obj_offset,
+                                     off_t obj_offset,
                                      unsigned long *size,
                                      unsigned long *store_size,
                                      unsigned int *delta_chain_length,
                                      unsigned char *base_sha1)
 {
        struct pack_window *w_curs = NULL;
-       unsigned long curpos, dummy;
+       off_t curpos;
+       unsigned long dummy;
        unsigned char *next_sha1;
        enum object_type type;
 
@@ -1200,6 +1212,7 @@ const char *packed_object_info_detail(struct packed_git *p,
                        obj_offset = get_delta_base(p, &w_curs, &curpos, type, obj_offset);
                        if (*delta_chain_length == 0) {
                                /* TODO: find base_sha1 as pointed by curpos */
+                               hashclr(base_sha1);
                        }
                        break;
                case OBJ_REF_DELTA:
@@ -1215,11 +1228,12 @@ const char *packed_object_info_detail(struct packed_git *p,
        }
 }
 
-static int packed_object_info(struct packed_git *p, unsigned long obj_offset,
+static int packed_object_info(struct packed_git *p, off_t obj_offset,
                              unsigned long *sizep)
 {
        struct pack_window *w_curs = NULL;
-       unsigned long size, curpos = obj_offset;
+       unsigned long size;
+       off_t curpos = obj_offset;
        enum object_type type;
 
        type = unpack_object_header(p, &w_curs, &curpos, &size);
@@ -1247,7 +1261,7 @@ static int packed_object_info(struct packed_git *p, unsigned long obj_offset,
 
 static void *unpack_compressed_entry(struct packed_git *p,
                                    struct pack_window **w_curs,
-                                   unsigned long curpos,
+                                   off_t curpos,
                                    unsigned long size)
 {
        int st;
@@ -1278,20 +1292,22 @@ static void *unpack_compressed_entry(struct packed_git *p,
 
 static void *unpack_delta_entry(struct packed_git *p,
                                struct pack_window **w_curs,
-                               unsigned long curpos,
+                               off_t curpos,
                                unsigned long delta_size,
-                               unsigned long obj_offset,
+                               off_t obj_offset,
                                enum object_type *type,
                                unsigned long *sizep)
 {
        void *delta_data, *result, *base;
-       unsigned long base_size, base_offset;
+       unsigned long base_size;
+       off_t base_offset;
 
        base_offset = get_delta_base(p, w_curs, &curpos, *type, obj_offset);
        base = unpack_entry(p, base_offset, type, &base_size);
        if (!base)
-               die("failed to read delta base object at %lu from %s",
-                   base_offset, p->pack_name);
+               die("failed to read delta base object"
+                   " at %"PRIuMAX" from %s",
+                   (uintmax_t)base_offset, p->pack_name);
 
        delta_data = unpack_compressed_entry(p, w_curs, curpos, delta_size);
        result = patch_delta(base, base_size,
@@ -1304,11 +1320,11 @@ static void *unpack_delta_entry(struct packed_git *p,
        return result;
 }
 
-void *unpack_entry(struct packed_git *p, unsigned long obj_offset,
+void *unpack_entry(struct packed_git *p, off_t obj_offset,
                   enum object_type *type, unsigned long *sizep)
 {
        struct pack_window *w_curs = NULL;
-       unsigned long curpos = obj_offset;
+       off_t curpos = obj_offset;
        void *data;
 
        *type = unpack_object_header(p, &w_curs, &curpos, sizep);
@@ -1331,23 +1347,23 @@ void *unpack_entry(struct packed_git *p, unsigned long obj_offset,
        return data;
 }
 
-int num_packed_objects(const struct packed_git *p)
+uint32_t num_packed_objects(const struct packed_git *p)
 {
        /* See check_packed_git_idx() */
-       return (p->index_size - 20 - 20 - 4*256) / 24;
+       return (uint32_t)((p->index_size - 20 - 20 - 4*256) / 24);
 }
 
-int nth_packed_object_sha1(const struct packed_git *p, int n,
+int nth_packed_object_sha1(const struct packed_git *p, uint32_t n,
                           unsigned char* sha1)
 {
        void *index = p->index_base + 256;
-       if (n < 0 || num_packed_objects(p) <= n)
+       if (num_packed_objects(p) <= n)
                return -1;
        hashcpy(sha1, (unsigned char *) index + (24 * n) + 4);
        return 0;
 }
 
-unsigned long find_pack_entry_one(const unsigned char *sha1,
+off_t find_pack_entry_one(const unsigned char *sha1,
                                  struct packed_git *p)
 {
        uint32_t *level1_ofs = p->index_base;
@@ -1389,7 +1405,7 @@ static int matches_pack_name(struct packed_git *p, const char *ig)
 static int find_pack_entry(const unsigned char *sha1, struct pack_entry *e, const char **ignore_packed)
 {
        struct packed_git *p;
-       unsigned long offset;
+       off_t offset;
 
        prepare_packed_git();
 
@@ -2056,11 +2072,10 @@ int index_pipe(unsigned char *sha1, int fd, const char *type, int write_object)
 int index_fd(unsigned char *sha1, int fd, struct stat *st, int write_object,
             enum object_type type, const char *path)
 {
-       unsigned long size = st->st_size;
-       void *buf;
+       size_t size = xsize_t(st->st_size);
+       void *buf = NULL;
        int ret, re_allocated = 0;
 
-       buf = "";
        if (size)
                buf = xmmap(NULL, size, PROT_READ, MAP_PRIVATE, fd, 0);
        close(fd);
@@ -2100,6 +2115,7 @@ int index_path(unsigned char *sha1, const char *path, struct stat *st, int write
 {
        int fd;
        char *target;
+       size_t len;
 
        switch (st->st_mode & S_IFMT) {
        case S_IFREG:
@@ -2112,16 +2128,17 @@ int index_path(unsigned char *sha1, const char *path, struct stat *st, int write
                                     path);
                break;
        case S_IFLNK:
-               target = xmalloc(st->st_size+1);
-               if (readlink(path, target, st->st_size+1) != st->st_size) {
+               len = xsize_t(st->st_size);
+               target = xmalloc(len + 1);
+               if (readlink(path, target, len + 1) != st->st_size) {
                        char *errstr = strerror(errno);
                        free(target);
                        return error("readlink(\"%s\"): %s", path,
                                     errstr);
                }
                if (!write_object)
-                       hash_sha1_file(target, st->st_size, blob_type, sha1);
-               else if (write_sha1_file(target, st->st_size, blob_type, sha1))
+                       hash_sha1_file(target, len, blob_type, sha1);
+               else if (write_sha1_file(target, len, blob_type, sha1))
                        return error("%s: failed to insert into database",
                                     path);
                free(target);
index 0781477a71ac4d76a1b8783868d6649cae7f8507..31812d3d26c7b33eaf3fe76f3145fd1fc193366d 100644 (file)
@@ -76,10 +76,10 @@ static int find_short_packed_object(int len, const unsigned char *match, unsigne
 
        prepare_packed_git();
        for (p = packed_git; p && found < 2; p = p->next) {
-               unsigned num = num_packed_objects(p);
-               unsigned first = 0, last = num;
+               uint32_t num = num_packed_objects(p);
+               uint32_t first = 0, last = num;
                while (first < last) {
-                       unsigned mid = (first + last) / 2;
+                       uint32_t mid = (first + last) / 2;
                        unsigned char now[20];
                        int cmp;
 
index 87403da780814787f6c4ea15a790381a5b2395d3..cacb273afff1fbddf152bb440451fa141589cf33 100644 (file)
@@ -114,7 +114,8 @@ test_expect_success \
 test_expect_success \
     'some edit' \
     'mv file file.orig &&
-    sed -e "s/^3A/99/" -e "/^1A/d" < file.orig > file &&
+    sed -e "s/^3A/99/" -e "/^1A/d" -e "/^incomplete/d" < file.orig > file &&
+    echo "incomplete" | tr -d "\\012" >>file &&
     GIT_AUTHOR_NAME="D" git commit -a -m "edit"'
 
 test_expect_success \
diff --git a/t/t2005-checkout-index-symlinks.sh b/t/t2005-checkout-index-symlinks.sh
new file mode 100755 (executable)
index 0000000..e34a515
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Johannes Sixt
+#
+
+test_description='git-checkout-index on filesystem w/o symlinks test.
+
+This tests that git-checkout-index creates a symbolic link as a plain
+file if core.symlinks is false.'
+
+. ./test-lib.sh
+
+test_expect_success \
+'preparation' '
+git-config core.symlinks false &&
+l=$(echo -n file | git-hash-object -t blob -w --stdin) &&
+echo "120000 $l        symlink" | git-update-index --index-info'
+
+test_expect_success \
+'the checked-out symlink must be a file' '
+git-checkout-index symlink &&
+test -f symlink'
+
+test_expect_success \
+'the file must be the blob we added during the setup' '
+test "$(git-hash-object -t blob symlink)" = $l'
+
+test_done
diff --git a/t/t2102-update-index-symlinks.sh b/t/t2102-update-index-symlinks.sh
new file mode 100755 (executable)
index 0000000..969ef89
--- /dev/null
@@ -0,0 +1,31 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Johannes Sixt
+#
+
+test_description='git-update-index on filesystem w/o symlinks test.
+
+This tests that git-update-index keeps the symbolic link property
+even if a plain file is in the working tree if core.symlinks is false.'
+
+. ./test-lib.sh
+
+test_expect_success \
+'preparation' '
+git-config core.symlinks false &&
+l=$(echo -n file | git-hash-object -t blob -w --stdin) &&
+echo "120000 $l        symlink" | git-update-index --index-info'
+
+test_expect_success \
+'modify the symbolic link' '
+echo -n new-file > symlink &&
+git-update-index symlink'
+
+test_expect_success \
+'the index entry must still be a symbolic link' '
+case "`git-ls-files --stage --cached symlink`" in
+120000" "*symlink) echo ok;;
+*) echo fail; git-ls-files --stage --cached symlink; (exit 1);;
+esac'
+
+test_done
index 7d93d0d7c90de94b0972d8fa5cd6d747c3fd2f56..b1c97b0dfb1748a7ba80c18d2d4b84bdee192c95 100755 (executable)
@@ -108,9 +108,9 @@ test_expect_success \
        cd victim &&
        git-config receive.denyNonFastforwards true &&
        cd .. &&
-       git-update-ref refs/heads/master master^ &&
-       git-send-pack --force ./victim/.git/ master &&
-       ! diff -u .git/refs/heads/master victim/.git/refs/heads/master
+       git-update-ref refs/heads/master master^ || return 1
+       git-send-pack --force ./victim/.git/ master && return 1
+       ! diff .git/refs/heads/master victim/.git/refs/heads/master
 '
 
 test_done
index 0514056ca6e8e54101b378cafd76b22a81df0ff5..0c0034e34c616fc8a385956a21e282a98b480b37 100755 (executable)
@@ -11,47 +11,91 @@ test_expect_success setup '
        git-update-index --add a &&
        tree0=$(git-write-tree) &&
        commit0=$(echo setup | git-commit-tree $tree0) &&
-       git-update-ref HEAD $commit0 &&
-       git-clone ./. victim &&
        echo We hope it works. >a &&
        git-update-index a &&
        tree1=$(git-write-tree) &&
        commit1=$(echo modify | git-commit-tree $tree1 -p $commit0) &&
-       git-update-ref HEAD $commit1
+       git-update-ref refs/heads/master $commit0 &&
+       git-update-ref refs/heads/tofail $commit1 &&
+       git-clone ./. victim &&
+       GIT_DIR=victim/.git git-update-ref refs/heads/tofail $commit1 &&
+       git-update-ref refs/heads/master $commit1 &&
+       git-update-ref refs/heads/tofail $commit0
 '
 
+cat >victim/.git/hooks/pre-receive <<'EOF'
+#!/bin/sh
+echo "$@" >>$GIT_DIR/pre-receive.args
+read x; printf "$x" >$GIT_DIR/pre-receive.stdin
+echo STDOUT pre-receive
+echo STDERR pre-receive >&2
+EOF
+chmod u+x victim/.git/hooks/pre-receive
+
 cat >victim/.git/hooks/update <<'EOF'
 #!/bin/sh
-echo "$@" >$GIT_DIR/update.args
+echo "$@" >>$GIT_DIR/update.args
 read x; printf "$x" >$GIT_DIR/update.stdin
-echo STDOUT update
-echo STDERR update >&2
+echo STDOUT update $1
+echo STDERR update $1 >&2
+test "$1" = refs/heads/master || exit
 EOF
 chmod u+x victim/.git/hooks/update
 
+cat >victim/.git/hooks/post-receive <<'EOF'
+#!/bin/sh
+echo "$@" >>$GIT_DIR/post-receive.args
+read x; printf "$x" >$GIT_DIR/post-receive.stdin
+echo STDOUT post-receive
+echo STDERR post-receive >&2
+EOF
+chmod u+x victim/.git/hooks/post-receive
+
 cat >victim/.git/hooks/post-update <<'EOF'
 #!/bin/sh
-echo "$@" >$GIT_DIR/post-update.args
+echo "$@" >>$GIT_DIR/post-update.args
 read x; printf "$x" >$GIT_DIR/post-update.stdin
 echo STDOUT post-update
 echo STDERR post-update >&2
 EOF
 chmod u+x victim/.git/hooks/post-update
 
-test_expect_success push '
-       git-send-pack ./victim/.git/ master >send.out 2>send.err
+test_expect_failure push '
+       git-send-pack --force ./victim/.git master tofail >send.out 2>send.err
+'
+
+test_expect_success 'updated as expected' '
+       test $(GIT_DIR=victim/.git git-rev-parse master) = $commit1 &&
+       test $(GIT_DIR=victim/.git git-rev-parse tofail) = $commit1
 '
 
 test_expect_success 'hooks ran' '
+       test -f victim/.git/pre-receive.args &&
+       test -f victim/.git/pre-receive.stdin &&
        test -f victim/.git/update.args &&
        test -f victim/.git/update.stdin &&
+       test -f victim/.git/post-receive.args &&
+       test -f victim/.git/post-receive.stdin &&
        test -f victim/.git/post-update.args &&
        test -f victim/.git/post-update.stdin
 '
 
+test_expect_success 'pre-receive hook arguments' '
+       echo \
+        refs/heads/master $commit0 $commit1 \
+        refs/heads/tofail $commit1 $commit0 \
+       | diff - victim/.git/pre-receive.args
+'
+
 test_expect_success 'update hook arguments' '
+       (echo refs/heads/master $commit0 $commit1;
+        echo refs/heads/tofail $commit1 $commit0
+       ) | diff - victim/.git/update.args
+'
+
+test_expect_success 'post-receive hook arguments' '
        echo refs/heads/master $commit0 $commit1 |
-       diff -u - victim/.git/update.args
+       diff - victim/.git/post-receive.args
 '
 
 test_expect_success 'post-update hook arguments' '
@@ -59,23 +103,32 @@ test_expect_success 'post-update hook arguments' '
        diff -u - victim/.git/post-update.args
 '
 
-test_expect_failure 'update hook stdin is /dev/null' '
-       test -s victim/.git/update.stdin
-'
-
-test_expect_failure 'post-update hook stdin is /dev/null' '
-       test -s victim/.git/post-update.stdin
+test_expect_success 'all hook stdin is /dev/null' '
+       ! test -s victim/.git/pre-receive.stdin &&
+       ! test -s victim/.git/update.stdin &&
+       ! test -s victim/.git/post-receive.stdin &&
+       ! test -s victim/.git/post-update.stdin
 '
 
 test_expect_failure 'send-pack produced no output' '
        test -s send.out
 '
 
+cat <<EOF >expect
+STDOUT pre-receive
+STDERR pre-receive
+STDOUT update refs/heads/master
+STDERR update refs/heads/master
+STDOUT update refs/heads/tofail
+STDERR update refs/heads/tofail
+STDOUT post-receive
+STDERR post-receive
+STDOUT post-update
+STDERR post-update
+EOF
 test_expect_success 'send-pack stderr contains hook messages' '
-       grep "STDOUT update" send.err &&
-       grep "STDERR update" send.err &&
-       grep "STDOUT post-update" send.err &&
-       grep "STDERR post-update" send.err
+       egrep ^STD send.err >actual &&
+       diff - actual <expect
 '
 
 test_done
diff --git a/t/t5515-fetch-merge-logic.sh b/t/t5515-fetch-merge-logic.sh
new file mode 100755 (executable)
index 0000000..0b600bb
--- /dev/null
@@ -0,0 +1,162 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Santi Béjar, based on t4013 by Junio C Hamano
+#
+#
+
+test_description='Merge logic in fetch'
+
+. ./test-lib.sh
+
+LF='
+'
+
+test_expect_success setup '
+       GIT_AUTHOR_DATE="2006-06-26 00:00:00 +0000" &&
+       GIT_COMMITTER_DATE="2006-06-26 00:00:00 +0000" &&
+       export GIT_AUTHOR_DATE GIT_COMMITTER_DATE &&
+
+       echo >file original &&
+       git add file &&
+       git commit -a -m One &&
+       git tag tag-one &&
+       git tag tag-one-tree HEAD^{tree} &&
+       git branch one &&
+
+       echo two >> file &&
+       git commit -a -m Two &&
+       git tag -a -m "Tag Two" tag-two &&
+       git branch two &&
+
+       echo three >> file &&
+       git commit -a -m Three &&
+       git tag -a -m "Tag Three" tag-three &&
+       git tag -a -m "Tag Three file" tag-three-file HEAD^{tree}:file &&
+       git branch three &&
+
+       echo master >> file &&
+       git commit -a -m Master &&
+       git tag -a -m "Tag Master" tag-master &&
+
+       git checkout three &&
+
+       git clone . cloned &&
+       cd cloned &&
+       git config remote.origin.url ../.git/ &&
+
+       git config remote.config-explicit.url ../.git/ &&
+       git config remote.config-explicit.fetch refs/heads/master:remotes/rem/master &&
+       git config --add remote.config-explicit.fetch refs/heads/one:remotes/rem/one &&
+       git config --add remote.config-explicit.fetch two:remotes/rem/two &&
+       git config --add remote.config-explicit.fetch refs/heads/three:remotes/rem/three &&
+       remotes="config-explicit" &&
+
+       git config remote.config-glob.url ../.git/ &&
+       git config remote.config-glob.fetch refs/heads/*:refs/remotes/rem/* &&
+       remotes="$remotes config-glob" &&
+
+       mkdir -p .git/remotes &&
+       {
+               echo "URL: ../.git/"
+               echo "Pull: refs/heads/master:remotes/rem/master"
+               echo "Pull: refs/heads/one:remotes/rem/one"
+               echo "Pull: two:remotes/rem/two"
+               echo "Pull: refs/heads/three:remotes/rem/three"
+       } >.git/remotes/remote-explicit &&
+       remotes="$remotes remote-explicit" &&
+
+       {
+               echo "URL: ../.git/"
+               echo "Pull: refs/heads/*:refs/remotes/rem/*"
+       } >.git/remotes/remote-glob &&
+       remotes="$remotes remote-glob" &&
+
+       mkdir -p .git/branches &&
+       echo "../.git" > .git/branches/branches-default &&
+       remotes="$remotes branches-default" &&
+
+       echo "../.git#one" > .git/branches/branches-one &&
+       remotes="$remotes branches-one" &&
+
+       for remote in $remotes ; do
+               git config branch.br-$remote.remote $remote &&
+               git config branch.br-$remote-merge.remote $remote &&
+               git config branch.br-$remote-merge.merge refs/heads/three &&
+               git config branch.br-$remote-octopus.remote $remote &&
+               git config branch.br-$remote-octopus.merge refs/heads/one &&
+               git config --add branch.br-$remote-octopus.merge two &&
+               git config --add branch.br-$remote-octopus.merge remotes/rem/three
+       done
+'
+
+# Merge logic depends on branch properties and Pull: or .fetch lines
+for remote in $remotes ; do
+    for branch in "" "-merge" "-octopus" ; do
+cat <<EOF
+br-$remote$branch
+br-$remote$branch $remote
+EOF
+    done
+done > tests
+
+# Merge logic does not depend on branch properties,
+# but does depend on Pull: or fetch lines.
+# Use two branches completely unrelated from the arguments,
+# the clone default and one without branch properties
+for branch in master br-unconfig ; do
+    echo $branch
+    for remote in $remotes ; do
+       echo $branch $remote
+    done
+done >> tests
+
+# Merge logic does not depend on branch properties
+# neither in the Pull: or .fetch config
+for branch in master br-unconfig ; do
+    cat <<EOF
+$branch ../.git
+$branch ../.git one
+$branch ../.git one two
+$branch --tags ../.git
+$branch ../.git tag tag-one tag tag-three
+$branch ../.git tag tag-one-tree tag tag-three-file
+$branch ../.git one tag tag-one tag tag-three-file
+EOF
+done >> tests
+
+while read cmd
+do
+       case "$cmd" in
+       '' | '#'*) continue ;;
+       esac
+       test=`echo "$cmd" | sed -e 's|[/ ][/ ]*|_|g'`
+       cnt=`expr $test_count + 1`
+       pfx=`printf "%04d" $cnt`
+       expect="../../t5515/fetch.$test"
+       actual="$pfx-fetch.$test"
+
+       test_expect_success "$cmd" '
+               {
+                       echo "# $cmd"
+                       set x $cmd; shift
+                       git symbolic-ref HEAD refs/heads/$1 ; shift
+                       rm -f .git/FETCH_HEAD
+                       rm -f .git/refs/heads/*
+                       rm -f .git/refs/remotes/rem/*
+                       rm -f .git/refs/tags/*
+                       git fetch "$@" >/dev/null
+                       cat .git/FETCH_HEAD
+               } >"$actual" &&
+               if test -f "$expect"
+               then
+                       diff -u "$expect" "$actual" &&
+                       rm -f "$actual"
+               else
+                       # this is to help developing new tests.
+                       cp "$actual" "$expect"
+                       false
+               fi
+       '
+done < tests
+
+test_done
diff --git a/t/t5515/fetch.br-branches-default b/t/t5515/fetch.br-branches-default
new file mode 100644 (file)
index 0000000..2e0414f
--- /dev/null
@@ -0,0 +1,8 @@
+# br-branches-default
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-default-merge b/t/t5515/fetch.br-branches-default-merge
new file mode 100644 (file)
index 0000000..ea65f31
--- /dev/null
@@ -0,0 +1,8 @@
+# br-branches-default-merge
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-default-merge_branches-default b/t/t5515/fetch.br-branches-default-merge_branches-default
new file mode 100644 (file)
index 0000000..7b5fa94
--- /dev/null
@@ -0,0 +1,8 @@
+# br-branches-default-merge branches-default
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-default-octopus b/t/t5515/fetch.br-branches-default-octopus
new file mode 100644 (file)
index 0000000..128397d
--- /dev/null
@@ -0,0 +1,8 @@
+# br-branches-default-octopus
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-default-octopus_branches-default b/t/t5515/fetch.br-branches-default-octopus_branches-default
new file mode 100644 (file)
index 0000000..4b37cd4
--- /dev/null
@@ -0,0 +1,8 @@
+# br-branches-default-octopus branches-default
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-default_branches-default b/t/t5515/fetch.br-branches-default_branches-default
new file mode 100644 (file)
index 0000000..4a2bf3c
--- /dev/null
@@ -0,0 +1,8 @@
+# br-branches-default branches-default
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-one b/t/t5515/fetch.br-branches-one
new file mode 100644 (file)
index 0000000..12ac8d2
--- /dev/null
@@ -0,0 +1,8 @@
+# br-branches-one
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-one-merge b/t/t5515/fetch.br-branches-one-merge
new file mode 100644 (file)
index 0000000..3a4e77e
--- /dev/null
@@ -0,0 +1,8 @@
+# br-branches-one-merge
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-one-merge_branches-one b/t/t5515/fetch.br-branches-one-merge_branches-one
new file mode 100644 (file)
index 0000000..00e04b4
--- /dev/null
@@ -0,0 +1,8 @@
+# br-branches-one-merge branches-one
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-one-octopus b/t/t5515/fetch.br-branches-one-octopus
new file mode 100644 (file)
index 0000000..53fe808
--- /dev/null
@@ -0,0 +1,8 @@
+# br-branches-one-octopus
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-one-octopus_branches-one b/t/t5515/fetch.br-branches-one-octopus_branches-one
new file mode 100644 (file)
index 0000000..41b18ff
--- /dev/null
@@ -0,0 +1,8 @@
+# br-branches-one-octopus branches-one
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-branches-one_branches-one b/t/t5515/fetch.br-branches-one_branches-one
new file mode 100644 (file)
index 0000000..281fa09
--- /dev/null
@@ -0,0 +1,8 @@
+# br-branches-one branches-one
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-explicit b/t/t5515/fetch.br-config-explicit
new file mode 100644 (file)
index 0000000..e2fa9c8
--- /dev/null
@@ -0,0 +1,11 @@
+# br-config-explicit
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-explicit-merge b/t/t5515/fetch.br-config-explicit-merge
new file mode 100644 (file)
index 0000000..ec1a723
--- /dev/null
@@ -0,0 +1,11 @@
+# br-config-explicit-merge
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-explicit-merge_config-explicit b/t/t5515/fetch.br-config-explicit-merge_config-explicit
new file mode 100644 (file)
index 0000000..54f6891
--- /dev/null
@@ -0,0 +1,11 @@
+# br-config-explicit-merge config-explicit
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-explicit-octopus b/t/t5515/fetch.br-config-explicit-octopus
new file mode 100644 (file)
index 0000000..7011dfc
--- /dev/null
@@ -0,0 +1,11 @@
+# br-config-explicit-octopus
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-explicit-octopus_config-explicit b/t/t5515/fetch.br-config-explicit-octopus_config-explicit
new file mode 100644 (file)
index 0000000..bdad51f
--- /dev/null
@@ -0,0 +1,11 @@
+# br-config-explicit-octopus config-explicit
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-explicit_config-explicit b/t/t5515/fetch.br-config-explicit_config-explicit
new file mode 100644 (file)
index 0000000..1b237dd
--- /dev/null
@@ -0,0 +1,11 @@
+# br-config-explicit config-explicit
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-glob b/t/t5515/fetch.br-config-glob
new file mode 100644 (file)
index 0000000..e75ec2f
--- /dev/null
@@ -0,0 +1,11 @@
+# br-config-glob
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-glob-merge b/t/t5515/fetch.br-config-glob-merge
new file mode 100644 (file)
index 0000000..ce8f739
--- /dev/null
@@ -0,0 +1,11 @@
+# br-config-glob-merge
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-glob-merge_config-glob b/t/t5515/fetch.br-config-glob-merge_config-glob
new file mode 100644 (file)
index 0000000..5817bed
--- /dev/null
@@ -0,0 +1,11 @@
+# br-config-glob-merge config-glob
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-glob-octopus b/t/t5515/fetch.br-config-glob-octopus
new file mode 100644 (file)
index 0000000..9ee213e
--- /dev/null
@@ -0,0 +1,11 @@
+# br-config-glob-octopus
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-glob-octopus_config-glob b/t/t5515/fetch.br-config-glob-octopus_config-glob
new file mode 100644 (file)
index 0000000..44bd0ec
--- /dev/null
@@ -0,0 +1,11 @@
+# br-config-glob-octopus config-glob
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-config-glob_config-glob b/t/t5515/fetch.br-config-glob_config-glob
new file mode 100644 (file)
index 0000000..a6c20f9
--- /dev/null
@@ -0,0 +1,11 @@
+# br-config-glob config-glob
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-explicit b/t/t5515/fetch.br-remote-explicit
new file mode 100644 (file)
index 0000000..83534d2
--- /dev/null
@@ -0,0 +1,11 @@
+# br-remote-explicit
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-explicit-merge b/t/t5515/fetch.br-remote-explicit-merge
new file mode 100644 (file)
index 0000000..a9064dd
--- /dev/null
@@ -0,0 +1,11 @@
+# br-remote-explicit-merge
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-explicit-merge_remote-explicit b/t/t5515/fetch.br-remote-explicit-merge_remote-explicit
new file mode 100644 (file)
index 0000000..732a37e
--- /dev/null
@@ -0,0 +1,11 @@
+# br-remote-explicit-merge remote-explicit
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-explicit-octopus b/t/t5515/fetch.br-remote-explicit-octopus
new file mode 100644 (file)
index 0000000..ecf020d
--- /dev/null
@@ -0,0 +1,11 @@
+# br-remote-explicit-octopus
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-explicit-octopus_remote-explicit b/t/t5515/fetch.br-remote-explicit-octopus_remote-explicit
new file mode 100644 (file)
index 0000000..af77531
--- /dev/null
@@ -0,0 +1,11 @@
+# br-remote-explicit-octopus remote-explicit
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-explicit_remote-explicit b/t/t5515/fetch.br-remote-explicit_remote-explicit
new file mode 100644 (file)
index 0000000..51fae56
--- /dev/null
@@ -0,0 +1,11 @@
+# br-remote-explicit remote-explicit
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-glob b/t/t5515/fetch.br-remote-glob
new file mode 100644 (file)
index 0000000..94e6ad3
--- /dev/null
@@ -0,0 +1,11 @@
+# br-remote-glob
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-glob-merge b/t/t5515/fetch.br-remote-glob-merge
new file mode 100644 (file)
index 0000000..09362e2
--- /dev/null
@@ -0,0 +1,11 @@
+# br-remote-glob-merge
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-glob-merge_remote-glob b/t/t5515/fetch.br-remote-glob-merge_remote-glob
new file mode 100644 (file)
index 0000000..e2eabec
--- /dev/null
@@ -0,0 +1,11 @@
+# br-remote-glob-merge remote-glob
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b               branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-glob-octopus b/t/t5515/fetch.br-remote-glob-octopus
new file mode 100644 (file)
index 0000000..c1554f8
--- /dev/null
@@ -0,0 +1,11 @@
+# br-remote-glob-octopus
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-glob-octopus_remote-glob b/t/t5515/fetch.br-remote-glob-octopus_remote-glob
new file mode 100644 (file)
index 0000000..e613434
--- /dev/null
@@ -0,0 +1,11 @@
+# br-remote-glob-octopus remote-glob
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-remote-glob_remote-glob b/t/t5515/fetch.br-remote-glob_remote-glob
new file mode 100644 (file)
index 0000000..646dbc8
--- /dev/null
@@ -0,0 +1,11 @@
+# br-remote-glob remote-glob
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig b/t/t5515/fetch.br-unconfig
new file mode 100644 (file)
index 0000000..65ce6d9
--- /dev/null
@@ -0,0 +1,11 @@
+# br-unconfig
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_--tags_.._.git b/t/t5515/fetch.br-unconfig_--tags_.._.git
new file mode 100644 (file)
index 0000000..8258c80
--- /dev/null
@@ -0,0 +1,7 @@
+# br-unconfig --tags ../.git
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_.._.git b/t/t5515/fetch.br-unconfig_.._.git
new file mode 100644 (file)
index 0000000..284bb1f
--- /dev/null
@@ -0,0 +1,2 @@
+# br-unconfig ../.git
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b               ../
diff --git a/t/t5515/fetch.br-unconfig_.._.git_one b/t/t5515/fetch.br-unconfig_.._.git_one
new file mode 100644 (file)
index 0000000..11eb5a6
--- /dev/null
@@ -0,0 +1,2 @@
+# br-unconfig ../.git one
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
diff --git a/t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file b/t/t5515/fetch.br-unconfig_.._.git_one_tag_tag-one_tag_tag-three-file
new file mode 100644 (file)
index 0000000..f02bab2
--- /dev/null
@@ -0,0 +1,8 @@
+# br-unconfig ../.git one tag tag-one tag tag-three-file
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689               tag 'tag-one' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_.._.git_one_two b/t/t5515/fetch.br-unconfig_.._.git_one_two
new file mode 100644 (file)
index 0000000..3f1be22
--- /dev/null
@@ -0,0 +1,3 @@
+# br-unconfig ../.git one two
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
diff --git a/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file b/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one-tree_tag_tag-three-file
new file mode 100644 (file)
index 0000000..85de411
--- /dev/null
@@ -0,0 +1,7 @@
+# br-unconfig ../.git tag tag-one-tree tag tag-three-file
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three b/t/t5515/fetch.br-unconfig_.._.git_tag_tag-one_tag_tag-three
new file mode 100644 (file)
index 0000000..0da2337
--- /dev/null
@@ -0,0 +1,7 @@
+# br-unconfig ../.git tag tag-one tag tag-three
+8e32a6d901327a23ef831511badce7bf3bf46689               tag 'tag-one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b               tag 'tag-three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_branches-default b/t/t5515/fetch.br-unconfig_branches-default
new file mode 100644 (file)
index 0000000..fc7041e
--- /dev/null
@@ -0,0 +1,8 @@
+# br-unconfig branches-default
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_branches-one b/t/t5515/fetch.br-unconfig_branches-one
new file mode 100644 (file)
index 0000000..e94cde7
--- /dev/null
@@ -0,0 +1,8 @@
+# br-unconfig branches-one
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_config-explicit b/t/t5515/fetch.br-unconfig_config-explicit
new file mode 100644 (file)
index 0000000..01a283e
--- /dev/null
@@ -0,0 +1,11 @@
+# br-unconfig config-explicit
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_config-glob b/t/t5515/fetch.br-unconfig_config-glob
new file mode 100644 (file)
index 0000000..3a556c5
--- /dev/null
@@ -0,0 +1,11 @@
+# br-unconfig config-glob
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_remote-explicit b/t/t5515/fetch.br-unconfig_remote-explicit
new file mode 100644 (file)
index 0000000..db216df
--- /dev/null
@@ -0,0 +1,11 @@
+# br-unconfig remote-explicit
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.br-unconfig_remote-glob b/t/t5515/fetch.br-unconfig_remote-glob
new file mode 100644 (file)
index 0000000..aee65c2
--- /dev/null
@@ -0,0 +1,11 @@
+# br-unconfig remote-glob
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master b/t/t5515/fetch.master
new file mode 100644 (file)
index 0000000..950fd07
--- /dev/null
@@ -0,0 +1,11 @@
+# master
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_--tags_.._.git b/t/t5515/fetch.master_--tags_.._.git
new file mode 100644 (file)
index 0000000..0e59950
--- /dev/null
@@ -0,0 +1,7 @@
+# master --tags ../.git
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_.._.git b/t/t5515/fetch.master_.._.git
new file mode 100644 (file)
index 0000000..66d1aad
--- /dev/null
@@ -0,0 +1,2 @@
+# master ../.git
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b               ../
diff --git a/t/t5515/fetch.master_.._.git_one b/t/t5515/fetch.master_.._.git_one
new file mode 100644 (file)
index 0000000..35deddb
--- /dev/null
@@ -0,0 +1,2 @@
+# master ../.git one
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
diff --git a/t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file b/t/t5515/fetch.master_.._.git_one_tag_tag-one_tag_tag-three-file
new file mode 100644 (file)
index 0000000..8286852
--- /dev/null
@@ -0,0 +1,8 @@
+# master ../.git one tag tag-one tag tag-three-file
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689               tag 'tag-one' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_.._.git_one_two b/t/t5515/fetch.master_.._.git_one_two
new file mode 100644 (file)
index 0000000..35ec578
--- /dev/null
@@ -0,0 +1,3 @@
+# master ../.git one two
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8               branch 'two' of ../
diff --git a/t/t5515/fetch.master_.._.git_tag_tag-one-tree_tag_tag-three-file b/t/t5515/fetch.master_.._.git_tag_tag-one-tree_tag_tag-three-file
new file mode 100644 (file)
index 0000000..2e133ef
--- /dev/null
@@ -0,0 +1,7 @@
+# master ../.git tag tag-one-tree tag tag-three-file
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three b/t/t5515/fetch.master_.._.git_tag_tag-one_tag_tag-three
new file mode 100644 (file)
index 0000000..92b18b4
--- /dev/null
@@ -0,0 +1,7 @@
+# master ../.git tag tag-one tag tag-three
+8e32a6d901327a23ef831511badce7bf3bf46689               tag 'tag-one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b               tag 'tag-three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_branches-default b/t/t5515/fetch.master_branches-default
new file mode 100644 (file)
index 0000000..603d6d2
--- /dev/null
@@ -0,0 +1,8 @@
+# master branches-default
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_branches-one b/t/t5515/fetch.master_branches-one
new file mode 100644 (file)
index 0000000..fe9bb0b
--- /dev/null
@@ -0,0 +1,8 @@
+# master branches-one
+8e32a6d901327a23ef831511badce7bf3bf46689               branch 'one' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_config-explicit b/t/t5515/fetch.master_config-explicit
new file mode 100644 (file)
index 0000000..4be97c7
--- /dev/null
@@ -0,0 +1,11 @@
+# master config-explicit
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_config-glob b/t/t5515/fetch.master_config-glob
new file mode 100644 (file)
index 0000000..cb0726f
--- /dev/null
@@ -0,0 +1,11 @@
+# master config-glob
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_remote-explicit b/t/t5515/fetch.master_remote-explicit
new file mode 100644 (file)
index 0000000..44a1ca8
--- /dev/null
@@ -0,0 +1,11 @@
+# master remote-explicit
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f               branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t5515/fetch.master_remote-glob b/t/t5515/fetch.master_remote-glob
new file mode 100644 (file)
index 0000000..724e8db
--- /dev/null
@@ -0,0 +1,11 @@
+# master remote-glob
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   branch 'master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   branch 'one' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   branch 'three' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   branch 'two' of ../
+754b754407bf032e9a2f9d5a9ad05ca79a6b228f       not-for-merge   tag 'tag-master' of ../
+8e32a6d901327a23ef831511badce7bf3bf46689       not-for-merge   tag 'tag-one' of ../
+22feea448b023a2d864ef94b013735af34d238ba       not-for-merge   tag 'tag-one-tree' of ../
+0567da4d5edd2ff4bb292a465ba9e64dcad9536b       not-for-merge   tag 'tag-three' of ../
+0e3b14047d3ee365f4f2a1b673db059c3972589c       not-for-merge   tag 'tag-three-file' of ../
+6134ee8f857693b96ff1cc98d3e2fd62b199e5a8       not-for-merge   tag 'tag-two' of ../
diff --git a/t/t6025-merge-symlinks.sh b/t/t6025-merge-symlinks.sh
new file mode 100644 (file)
index 0000000..3c1a697
--- /dev/null
@@ -0,0 +1,62 @@
+#!/bin/sh
+#
+# Copyright (c) 2007 Johannes Sixt
+#
+
+test_description='merging symlinks on filesystem w/o symlink support.
+
+This tests that git-merge-recursive writes merge results as plain files
+if core.symlinks is false.'
+
+. ./test-lib.sh
+
+test_expect_success \
+'setup' '
+git-config core.symlinks false &&
+> file &&
+git-add file &&
+git-commit -m initial &&
+git-branch b-symlink &&
+git-branch b-file &&
+l=$(echo -n file | git-hash-object -t blob -w --stdin) &&
+echo "120000 $l        symlink" | git-update-index --index-info &&
+git-commit -m master &&
+git-checkout b-symlink &&
+l=$(echo -n file-different | git-hash-object -t blob -w --stdin) &&
+echo "120000 $l        symlink" | git-update-index --index-info &&
+git-commit -m b-symlink &&
+git-checkout b-file &&
+echo plain-file > symlink &&
+git-add symlink &&
+git-commit -m b-file'
+
+test_expect_failure \
+'merge master into b-symlink, which has a different symbolic link' '
+! git-checkout b-symlink ||
+git-merge master'
+
+test_expect_success \
+'the merge result must be a file' '
+test -f symlink'
+
+test_expect_failure \
+'merge master into b-file, which has a file instead of a symbolic link' '
+! (git-reset --hard &&
+git-checkout b-file) ||
+git-merge master'
+
+test_expect_success \
+'the merge result must be a file' '
+test -f symlink'
+
+test_expect_failure \
+'merge b-file, which has a file instead of a symbolic link, into master' '
+! (git-reset --hard &&
+git-checkout master) ||
+git-merge b-file'
+
+test_expect_success \
+'the merge result must be a file' '
+test -f symlink'
+
+test_done
index 970d683650f5ee6b99a07ff10063710292b28ed1..2e1a09ff2db29421629b038a3374449c49bdc79d 100755 (executable)
@@ -111,6 +111,14 @@ test_expect_success \
        'A: verify marks output' \
        'diff -u expect marks.out'
 
+test_expect_success \
+       'A: verify marks import' \
+       'git-fast-import \
+               --import-marks=marks.out \
+               --export-marks=marks.new \
+               </dev/null &&
+       diff -u expect marks.new'
+
 ###
 ### series B
 ###
index 804bbb6c9eb788714afb493e331341206cebaaf3..498bf50eb86f9e437dae89fc631499b73a8ec116 100644 (file)
@@ -26,7 +26,7 @@ static const char upload_pack_usage[] = "git-upload-pack [--strict] [--timeout=n
 static unsigned long oldest_have;
 
 static int multi_ack, nr_our_refs;
-static int use_thin_pack, use_ofs_delta;
+static int use_thin_pack, use_ofs_delta, no_progress;
 static struct object_array have_obj;
 static struct object_array want_obj;
 static unsigned int timeout;
@@ -164,6 +164,9 @@ static void create_pack_file(void)
                die("git-upload-pack: unable to fork git-pack-objects");
        }
        if (!pid_pack_objects) {
+               const char *argv[10];
+               int i = 0;
+
                dup2(lp_pipe[0], 0);
                dup2(pu_pipe[1], 1);
                dup2(pe_pipe[1], 2);
@@ -174,9 +177,16 @@ static void create_pack_file(void)
                close(pu_pipe[1]);
                close(pe_pipe[0]);
                close(pe_pipe[1]);
-               execl_git_cmd("pack-objects", "--stdout", "--progress",
-                             use_ofs_delta ? "--delta-base-offset" : NULL,
-                             NULL);
+
+               argv[i++] = "pack-objects";
+               argv[i++] = "--stdout";
+               if (!no_progress)
+                       argv[i++] = "--progress";
+               if (use_ofs_delta)
+                       argv[i++] = "--delta-base-offset";
+               argv[i++] = NULL;
+
+               execv_git_cmd(argv);
                kill(pid_rev_list, SIGKILL);
                die("git-upload-pack: unable to exec git-pack-objects");
        }
@@ -537,6 +547,8 @@ static void receive_needs(void)
                        use_sideband = LARGE_PACKET_MAX;
                else if (strstr(line+45, "side-band"))
                        use_sideband = DEFAULT_PACKET_MAX;
+               if (strstr(line+45, "no-progress"))
+                       no_progress = 1;
 
                /* We have sent all our refs already, and the other end
                 * should have chosen out of them; otherwise they are
@@ -605,7 +617,7 @@ static void receive_needs(void)
 static int send_ref(const char *refname, const unsigned char *sha1, int flag, void *cb_data)
 {
        static const char *capabilities = "multi_ack thin-pack side-band"
-               " side-band-64k ofs-delta shallow";
+               " side-band-64k ofs-delta shallow no-progress";
        struct object *o = parse_object(sha1);
 
        if (!o)
index 6c1f99b149f0800a9c9ab1b45033bc1401a84766..10816e95a07c23dda7554c102c306d7e9beca606 100644 (file)
@@ -107,16 +107,18 @@ int read_mmfile(mmfile_t *ptr, const char *filename)
 {
        struct stat st;
        FILE *f;
+       size_t sz;
 
        if (stat(filename, &st))
                return error("Could not stat %s", filename);
        if ((f = fopen(filename, "rb")) == NULL)
                return error("Could not open %s", filename);
-       ptr->ptr = xmalloc(st.st_size);
-       if (fread(ptr->ptr, st.st_size, 1, f) != 1)
+       sz = xsize_t(st.st_size);
+       ptr->ptr = xmalloc(sz);
+       if (fread(ptr->ptr, sz, 1, f) != 1)
                return error("Could not read %s", filename);
        fclose(f);
-       ptr->size = st.st_size;
+       ptr->size = sz;
        return 0;
 }