Commit Graph

6705 Commits

Author SHA1 Message Date
Vicent Marti
3ed8d00cc8 Merge pull request #2258 from libgit2/jk/userdiff-cc
pull userdiff pattern updates from git.git
2014-04-09 12:08:30 +02:00
Jeff King
9ce60fadda userdiff: update ada patterns
This is the moral equivalent of

  git/git@39a87a29ce

from Adrian Johnson <ajohnson@redneon.com>.
2014-04-08 18:46:56 -04:00
Jeff King
76b4e3d4de userdiff: update C/C++ patterns
This pulls upstream changes from:

  git/git@8a2e8da367

  git/git@abf8f98602

  git/git@407e07f2a6

all by Johannes Sixt <j6t@kdbg.org>.
2014-04-08 18:46:56 -04:00
Russell Belfer
eb7e17cc90 Update submodules with parent-tracked content
This updates how libgit2 treats submodule-like directories that
actually have tracked content inside of them.  This is a strange
corner case, but it seems that many people have abortive submodule
setups and then just went ahead and added the files into the
parent repository.  In this case, we should just treat the
submodule as if it was a normal directory.

Libgit2 will still try to skip over real submodules and contained
repositories that do not have tracked files inside them, but this
adds some new handling for cases where the apparently submodule
data is in conflict with the actual list of tracked files.
2014-04-08 14:47:20 -07:00
Carlos Martín Nieto
ce2e82694a graph: handle not finding a merge base gracefully
git_merge_base() returns GIT_ENOTFOUND when it cannot find a merge
base. graph_desdendant_of() returns a boolean value (barring any
errors), so it needs to catch the NOTFOUND return value and convert it
into false, as not merge base means it cannot be a descendant.
2014-04-08 16:52:20 +02:00
Vicent Marti
2795fb4ddd Merge pull request #2256 from jacquesg/graph-descendant
Correct grouping of parentheses
2014-04-08 16:37:39 +02:00
Jacques Germishuys
8a8e312792 Added a no path test for git_graph_descendant_of 2014-04-08 16:32:06 +02:00
Jacques Germishuys
56f8e06e49 Correct grouping of parentheses
git_graph_descendant_of was returning the result of an assignment
2014-04-08 16:30:26 +02:00
Edward Thomson
7be1caf7f5 Determine crlf safety by statistics, not literal reversibility 2014-04-07 21:41:36 -07:00
Edward Thomson
855c66de66 Introduce core.safecrlf handling 2014-04-07 21:09:09 -07:00
Vicent Marti
5f74c47693 Merge pull request #2255 from libgit2/rb/fix-multiple-nfd-iconv-bug
Fix bug with multiple iconv conversions in one dir
2014-04-07 20:51:39 +02:00
Russell Belfer
7167fd7ef8 vmg is always right 2014-04-07 11:51:12 -07:00
Russell Belfer
c813b34550 Fix bug with multiple iconv conversions in one dir
The internal buffer in the `git_path_iconv_t` structure was not
being reset before the calls to `iconv` were made to convert data,
so if there were multiple decomposed Unicode paths in a single
directory, paths after the first one were being appended to the
first instead of treated as independent data.
2014-04-07 11:45:32 -07:00
Jacques Germishuys
553184a762 Update AUTHORS 2014-04-07 20:18:17 +02:00
Jacques Germishuys
c031129510 git_repository_state_cleanup() should remove rebase-merge/, rebase-apply/ and BISECT_LOG 2014-04-07 17:35:28 +02:00
Vicent Marti
6720eef938 Merge pull request #2249 from libgit2/rb/starstar-fnmatch
Add support for ** matches in ignores
2014-04-07 11:22:23 +02:00
Russell Belfer
c7d9606066 Fix fnmatch comment to be clearer 2014-04-06 11:20:22 -07:00
Russell Belfer
c8c91433a8 More ** tests for pattern rules 2014-04-06 10:42:26 -07:00
Vicent Marti
52056db9c1 Merge pull request #2250 from jacquesg/vector-leak
Don't lose our elements when calling git_vector_set()
2014-04-06 16:22:29 +02:00
Jacques Germishuys
4998009a28 Don't lose our elements when calling git_vector_set() 2014-04-06 15:16:44 +02:00
Russell Belfer
2b6b85f116 Add support for ** matches in ignores
This is an experimental addition to add ** support to fnmatch
pattern matching in libgit2.  It needs more testing.
2014-04-04 17:02:12 -07:00
Vicent Marti
923c84008d Merge pull request #2215 from libgit2/rb/submodule-cache-fixes
Improve submodule cache management
2014-04-04 14:24:08 +02:00
Vicent Marti
f34408a7b4 Merge pull request #2211 from Yogu/retry-renaming-config
Retry committing locked files on error
2014-04-04 14:23:07 +02:00
Russell Belfer
eedeeb9e8f Test (and fix) the git_submodule_sync changes
I wrote this stuff a while ago and forgot to write tests.  Wanted
to do so now to wrap up the PR and immediately found problems.
2014-04-03 11:58:51 -07:00
Russell Belfer
18cc7d28c4 Minor code cleanup 2014-04-03 11:29:08 -07:00
Jan Melcher
f2fb4bac68 git_submodule_resolve_url supports relative urls
The base for the relative urls is determined as follows, with descending
priority:

- remote url of HEAD's remote tracking branch
- remote "origin"
- workdir

This follows git.git behaviour
2014-04-03 10:44:08 -07:00
Jan Melcher
12d4ed4de3 Test git_submodule_add_setup with relative url 2014-04-03 10:00:36 -07:00
Vicent Marti
4c219cf648 Merge pull request #2244 from jacquesg/const-correctness
Const correctness!
2014-04-03 17:12:11 +02:00
Jacques Germishuys
3b4ba27870 Const correctness! 2014-04-03 16:06:31 +02:00
Vicent Marti
fd61f05ea6 Merge pull request #2238 from libgit2/cmn/upstream-for-unborn
Handle an upstream branch for an unborn one
2014-04-03 09:53:28 +02:00
Vicent Marti
9edc5271e6 Merge pull request #2239 from libgit2/vmg/clar-skip-test
Skip tests on Clar
2014-04-03 09:52:42 +02:00
Carlos Martín Nieto
67d4997a7e remote: mark branch for-merge even if we're unborn
When the current branch is unborn, git will still mark the current
branch's upstream for-merge if there is an upstream configuration. The
only non-constrived case is cloning from an empty repository which then
gains history. origin's master should be marked for-merge.

In order to do this, we cannot use the high-level wrappers that expect a
reference, as we may not have one. Move over to the internal ones that
expect a reference name, which we do have.
2014-04-02 20:22:22 +02:00
Carlos Martín Nieto
6f6be8fe41 remote: write tests for cloning from an empty repo
Cloning from an empty repo must set master's upstream to origin's
master, even if neither of them exist.

Fetching from a non-empty origin must then mark the master branch
for-merge. This currently fails.
2014-04-02 20:22:22 +02:00
Vicent Marti
0f65733b08 Clar: skip tests 2014-04-02 18:50:47 +02:00
Vicent Marti
64a862c2b8 Merge pull request #2237 from mekishizufu/fix_return_value
Fix submodule_is_config_only's return value
2014-04-02 18:48:38 +02:00
Jiri Pospisil
49653665d1 checkout: Fix submodule_is_config_only's return value 2014-04-02 18:21:41 +02:00
Vicent Marti
fe23860aac Merge pull request #2230 from anuraggup/revwalk-merge-base
No need to find merge base.
2014-04-02 17:45:25 +02:00
Russell Belfer
ada157b237 Add warning when skipping blame test 2014-04-02 07:45:16 -07:00
Vicent Marti
bb63baea5f Merge pull request #2231 from libgit2/fix-memory-index-doc-comment
Correct a stale reference to GIT_EBAREINDEX
2014-04-02 14:13:01 +02:00
Rob Rix
ddc66e27b6 Give the correct name for the function in the doc.
Per @carlosmn, git_index_add is now named git_index_add_bypath.
2014-04-02 08:02:43 -04:00
Vicent Marti
5b9eac32c3 Merge pull request #2233 from libgit2/rb/fix-untracked-repo-status
Skip untracked contained repo contents even with gitlink files
2014-04-02 13:42:14 +02:00
Russell Belfer
d1a0900442 Skip blame libgit2 test if not in libgit2 repo
One blame test replies on being run from within the libgit2
repository to leverage having a longer history to play with, but
some bundled versions of libgit2 don't have the whole libgit2
history.  This just skips that test if the repository can't be
opened.
2014-04-01 21:58:48 -07:00
Russell Belfer
a574d584df New tests of status for repo inside repo 2014-04-01 21:32:06 -07:00
Russell Belfer
ea1ca3c921 Fix skipping content of contained repos
When doing a diff for use in status, we should never show the
content of a git repository contained inside another one.  The
logic to do this was looking for a .git directory and so when a
gitlink plain .git file was used, it was failing to exclude the
directory content.
2014-04-01 21:30:52 -07:00
Russell Belfer
8f4e5275e4 More tests and fix submodule index refresh
There was a little bug where the submodule cache thought that the
index date was out of date even when it wasn't that was resulting
in some extra scans of index data even when not needed.

Mostly this commit adds a bunch of new tests including adding and
removing submodules in the index and in the HEAD and seeing if we
can automatically pick them up when refreshing.
2014-04-01 16:46:25 -07:00
Rob Rix
bb439de039 Correct a stale reference to GIT_EBAREINDEX 2014-04-01 16:37:19 -04:00
Russell Belfer
8061d519b3 Remove most submodule reloads from tests
With the new submodule cache validity checks, we generally don't
need to call git_submodule_reload_all to have up-to-date submodule
data.  Some tests are still calling it where I want to actually
test that it can be called safely and doesn't break anything, but
mostly it is not needed.

This also expands some of the existing submodule tests to cover
some variants on the behavior that was already being tested.
2014-04-01 13:24:06 -07:00
Russell Belfer
4ece3e225b Fix submodule accounting for name and path changes
Wrote tests that try adding, removing, and updating the name of
submodules which showed a number of problems with how we account
for changes when incrementally updating the submodule info.  Most
of these issues didn't exist before because reloading would always
blow away the old submodule data.
2014-04-01 12:19:11 -07:00
Carlos Martín Nieto
f28e4c97b3 refspec: git_refspec_parse() does not exist 2014-04-01 20:18:36 +02:00
Russell Belfer
aa78c9ba77 Minor submodule cache locking improvements
This improvement the management of the lock around submodule cache
updates slightly, using the lock to make sure that foreach can
safely make a snapshot of all existing submodules and making sure
that git_submodule_add_setup also grabs a lock before inserting
the new submodule.  Cache initialization / refresh should already
have been holding the lock correctly as it adds submodules.
2014-04-01 10:22:51 -07:00