Commit Graph

5146 Commits

Author SHA1 Message Date
Vicent Martí
cfcdbc100a Merge pull request #1523 from libgit2/vmg/namespaces
Namespace support
2013-05-01 03:03:17 -07:00
Edward Thomson
75d1c8c664 move NAME and REUC extensions to sys/ 2013-04-30 17:33:11 -05:00
Edward Thomson
0462fba538 renames! 2013-04-30 16:01:11 -05:00
Edward Thomson
bec65a5e99 merge! 2013-04-30 15:31:31 -05:00
Vicent Marti
bade51948c lol namespaces 2013-04-30 21:02:13 +02:00
Vicent Martí
5e2261aca8 Merge pull request #1507 from arrbee/fix-look-inside-untracked-directory
Update diff handling of "untracked" directories
2013-04-30 10:29:46 -07:00
Russell Belfer
5fa7e46984 Fix some formatting inconsistency 2013-04-30 04:27:46 -07:00
Russell Belfer
61c00541ac Update comment for clarity 2013-04-30 04:25:56 -07:00
Russell Belfer
a66c4bc846 More tests for diff untracked directories
This includes more tests for various scenarios when diff includes
an untracked directory in the workdir with contents either ignored
or not.
2013-04-30 04:25:56 -07:00
Russell Belfer
e26b14c034 Update diff handling of untracked directories
When diff encounters an untracked directory, there was a shortcut
that it took which is not compatible with core git.  This makes
the default behavior no longer take that shortcut and instead look
inside the untracked directory to see if there are any untracked
files within it.  If there are not, then the directory is treated
as an ignore directory instead of an untracked directory.  This
has implications for the git_status APIs.
2013-04-30 04:25:56 -07:00
Russell Belfer
fdb3034e72 Reorganize diff code into functions
In preparation for more changes to the internal diff logic, it
seemed wise to split the very large git_diff__from_iterators into
separate functions that handle the four main cases (unmatched old
item, unmatched new item, unmatched new directory, and matched
old and new items).  Hopefully this will keep the logic easier to
follow even as more cases have to be added to this code.
2013-04-30 04:25:56 -07:00
Vicent Marti
7dcda3aa37 object: haha 2013-04-30 13:19:02 +02:00
Vicent Marti
0b726701f3 object: Explicitly define helper API methods for all obj types 2013-04-30 13:13:38 +02:00
Vicent Martí
cd2ed9f0cc Merge pull request #1518 from arrbee/export-oid-comparison
Remove most inlines from the public API
2013-04-30 04:02:52 -07:00
Vicent Martí
d76fb20ebc Merge pull request #1520 from carlosmn/nth-refspec
Add refspec list accessors
2013-04-30 03:29:48 -07:00
Vicent Martí
099c1b747a Merge pull request #1522 from arrbee/repo-open-with-no-config
Catch issue in config set with no config file
2013-04-30 03:28:56 -07:00
Russell Belfer
0a1755c045 Catch issue in config set with no config file
This prevents a segfault when setting a value in the config of a
repository that doesn't have a config file.
2013-04-30 03:15:45 -07:00
Carlos Martín Nieto
9c5d4b2e80 remote: fix a leak when dwim'ing refspecs 2013-04-30 12:05:16 +02:00
Carlos Martín Nieto
1ffd0806f4 remote: add resfpec list accessors
Bring back a way of acessing the git_refspec* from a remote.

Closes #1514
2013-04-30 12:04:59 +02:00
Carlos Martín Nieto
8d39f2a790 refspec: add direction accessor 2013-04-30 10:55:17 +02:00
Russell Belfer
203d5b0e68 Some cleanups
Removed useless prototype and renamed object typecast functions
declaration macro.
2013-04-29 18:20:58 -07:00
Russell Belfer
e4af0f0016 Add new src/oid.h 2013-04-29 18:15:43 -07:00
Russell Belfer
d77611022c Standardize cast versions of git_object accessors
This removes the GIT_INLINE versions of the simple git_object
accessors and standardizes them with a helper macro in src/object.h
to build the function bodies.
2013-04-29 14:22:06 -07:00
Russell Belfer
b7f167da29 Make git_oid_cmp public and add git_oid__cmp 2013-04-29 13:52:12 -07:00
Vicent Martí
4157851076 Merge pull request #1511 from carlosmn/refspec-shorthand
dwim shorthand refspecs for fetch
2013-04-29 13:30:31 -07:00
Vicent Martí
bb503dbd03 Merge pull request #1516 from ethomson/win32_alternate_nostat
don't use uninitialized struct stat in win32
2013-04-29 10:21:03 -07:00
Edward Thomson
c8a4e8a5f6 don't use uninitialized struct stat in win32 2013-04-29 11:14:56 -05:00
Vicent Martí
51a91ce8c6 Merge pull request #1513 from ethomson/cmake
cmake 2.6 parser bug workaround
2013-04-29 09:09:27 -07:00
Edward Thomson
ac1d85cf11 cmake 2.6 parser bug workaround 2013-04-29 11:00:05 -05:00
Russell Belfer
aa8f010120 Add git_oid_strcmp and use it for git_oid_streq
Add a new git_oid_strcmp that compares a string OID with a hex
oid for sort order, and then reimplement git_oid_streq using it.
This actually should speed up git_oid_streq because it only reads
as far into the string as it needs to, whereas previously it would
convert the whole string into an OID and then use git_oid_cmp.
2013-04-29 08:59:46 -07:00
Russell Belfer
8564a0224a Fix fragile git_oid_ncmp
git_oid_ncmp was making some assumptions about the length of
the data - this shifts the check to the top of the loop so it
will work more robustly, limits the max, and adds some tests
to verify the functionality.
2013-04-29 08:51:24 -07:00
Russell Belfer
0c72248b91 Introduce git_oid_compare, an exported oid cmp 2013-04-29 07:34:13 -07:00
Carlos Martín Nieto
0f85c20840 Merge pull request #1512 from carlosmn/push-delete-only
Fix push for delete-only and add travis rules to test it
2013-04-29 04:13:42 -07:00
Carlos Martín Nieto
fb42a22e2f travis: test push
Create a test repository in the VM and set up git-daemon so we can
use it to test the push code.
2013-04-29 02:15:51 +02:00
Carlos Martín Nieto
51e4da6d8a push: don't send a packfile when only issuing delete commands
For update and create commands where all the objects are known to
exist in the remote, we must send an empty packfile. However, if all
we issue are delete commands, no packfile must be sent.

Take this into consideration for push.
2013-04-29 01:49:40 +02:00
Carlos Martín Nieto
d84884571d remote: dwim the refspecs according to the remote's advertised refs
As git allows you to store shorthand refspecs in the configuration, we
need to do this ourselves.
2013-04-28 18:49:51 +02:00
Carlos Martín Nieto
528a4e24c6 Parse shorthand refspecs as valid
Relax the ONELEVEL ref naming rules so the refspec parsing code can
ask for 'master' to be considered valid.
2013-04-28 14:21:10 +02:00
Vicent Martí
78bf2944ed Merge pull request #1504 from ethomson/git_atomic_ssize
git_atomic_ssize for 64-bit atomics only on 64-bit platforms
2013-04-25 17:42:44 -07:00
Edward Thomson
eb63fda2e2 git_atomic_ssize for 64-bit atomics only on 64-bit platforms 2013-04-25 12:40:33 -05:00
Carlos Martín Nieto
b4117e19b7 docs: formatting fixes 2013-04-24 20:25:57 +02:00
Vicent Marti
879458e7cf repo: Add git_repository__cleanup 2013-04-24 15:52:58 +02:00
Vicent Martí
2370b4d79e Merge pull request #1499 from arrbee/fix-diff-config-usage
Support more diff config options and use the config cache more
2013-04-23 13:06:26 -07:00
Russell Belfer
687db88faf Make sure diff output is cleared on error 2013-04-23 12:57:30 -07:00
Russell Belfer
b1ff7004ab Improve diff config options handling
This makes diff use the cvar cache for config options where
possible, and also adds support for a number of other config
options to diff including "diff.context", "diff.ignoreSubmodules",
"diff.noprefix", "diff.mnemonicprefix", and "core.abbrev".

To make this natural, this involved a rearrangement of the code
that allocates the diff object vs. the code that initializes it
based on the combination of options passed in by the user and
read from the config.

This commit includes tests for most of these new options as well.
2013-04-23 12:57:30 -07:00
Russell Belfer
6be368bf16 Clear repo config cache when cfgs are set
This is a conservative change, but it seemed like the only safe
thing to do -- i.e. clear the cvar cache when a config gets set.
2013-04-23 12:57:30 -07:00
Russell Belfer
eac76c230c Use config cache where possible
This converts many of the config lookups that are done around the
library to use the repository config cache.  This was everything I
could find that wasn't part of diff (which requires a larger fix).
2013-04-23 12:57:30 -07:00
Russell Belfer
ab01cbd4dd Add configs to repo config cache
This adds a bunch of additional config values to the repository
config value cache and makes it easier to add a simple boolean
config without creating enum values for each possible setting.

Also, this fixes a bug in git_config_refresh where the config
cache was not being cleared which could lead to potential
incorrect values.

The work to start using the new cached configs will come in the
next couple of commits...
2013-04-23 12:57:30 -07:00
Russell Belfer
608d04667a Make tree to tree diffs case sensitive
When case insensitive tree iterators were added, we started reading
the case sensitivity of the index to decide if the tree should be
case sensitive.  This is good for index-to-tree comparisons, but
for tree-to-tree comparisons, we should really default to doing a
case sensitive comparison unless the user really wants otherwise.
2013-04-23 12:57:30 -07:00
Linquize
a5df71c11f Support diff.context config 2013-04-23 12:57:30 -07:00
Ben Straub
bd0a07f4bb Clone: replace fetch spec with custom value 2013-04-23 12:28:59 -07:00