Commit Graph

4665 Commits

Author SHA1 Message Date
Russell Belfer
6e286e8dc5 Remove obsolete test for peel type
Peeling to an invalid type is now checked via an assert so this
test is no longer relevant.
2013-05-04 01:04:23 -07:00
Russell Belfer
0cce210a54 Use assert for peel target type check 2013-05-02 10:36:58 -07:00
Russell Belfer
b60d95c714 clarify error propogation 2013-05-01 15:55:54 -07:00
Russell Belfer
2f28219ce3 clarify where error message is set 2013-05-01 15:53:12 -07:00
Russell Belfer
52c5273735 Clear error msg when we eat error silently 2013-05-01 15:51:30 -07:00
Russell Belfer
f470b00b03 Fix one error not reported in revparse
There are many paths through revparse that may return an error
code without reporting an error, I believe.  This fixes one of
them.  Because of the backtracking in revparse, it is pretty
complicated to fix the others.
2013-05-01 15:48:40 -07:00
Russell Belfer
1a9e406c21 minor missing error message 2013-05-01 15:47:37 -07:00
Russell Belfer
bf6bebe22e Factor out some code that needed to clear errors
A number of places were looking up option config values and then
not clearing the error codes if the values were not found.  This
moves the repeated pattern into a shared routine and adds the
extra call to giterr_clear() when needed.
2013-05-01 15:23:40 -07:00
Russell Belfer
41e93563e7 Error messages for a couple other boundary conditions 2013-05-01 15:08:12 -07:00
Russell Belfer
62caf3f38f Report some errors returnable by push 2013-05-01 15:01:47 -07:00
Russell Belfer
f063f57898 Catch some odd odb backend corner case errors
There are some cases, particularly where no loaded ODB backends
support a particular operation, where we would return an error
code without having set an error.  This catches those cases and
reports that no ODB backends support the operation in question.
2013-05-01 14:48:35 -07:00
Russell Belfer
8915a140cb Report a couple object error conditions 2013-05-01 14:23:01 -07:00
Russell Belfer
734c6fc134 Report errors finding notes 2013-05-01 14:15:55 -07:00
Russell Belfer
de19c4a958 Set error when no merge base is found 2013-05-01 14:00:20 -07:00
Russell Belfer
e830c020f3 Report stat error when checking if file modified 2013-05-01 13:50:39 -07:00
Russell Belfer
52c102b7f6 More care reporting diff patch iteration errors 2013-05-01 13:43:48 -07:00
Russell Belfer
3f663178ed More care catching and setting config errors 2013-05-01 13:38:56 -07:00
Russell Belfer
155ee75114 Add error messages for failed submodule lookup 2013-05-01 05:34:01 -07:00
Russell Belfer
46779411f9 fix typo 2013-05-01 05:32:10 -07:00
Russell Belfer
ae99f5e2ab Make sure error messages get set 2013-05-01 04:57:24 -07:00
Russell Belfer
f6f48f9008 Simplify error reporting 2013-05-01 04:57:05 -07:00
Russell Belfer
3e199f4285 Set error message for branch functions
There were a couple of places where an error was being returned
from branch related code but no error message was being set.
2013-05-01 04:18:46 -07:00
Vicent Martí
cfcdbc100a Merge pull request #1523 from libgit2/vmg/namespaces
Namespace support
2013-05-01 03:03:17 -07: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