Commit Graph

5254 Commits

Author SHA1 Message Date
Russell Belfer
72b3dd4a5c Use GIT_IDXENTRY_STAGE macro
Since I added the GIT_IDXENTRY_STAGE macro to extract the stage
from a git_index_entry, we probably don't need an internal inline
function to do the same thing.
2013-05-15 15:23:33 -07:00
Russell Belfer
09fae31d45 Improve robustness of diff rename detection
Under some strange circumstances, diffs can end up listing files
that we can't actually open successfully.  Instead of aborting
the git_diff_find_similar, this makes it so that those files just
won't be considered as valid rename/copy targets instead.
2013-05-15 14:58:26 -07:00
Russell Belfer
dcb0f7c061 Fix checkout of submodules with no .gitmodules
It is possible for there to be a submodule in a repository with
no .gitmodules file (for example, if the user forgot to commit
the .gitmodules file).  In this case, core Git will just create
an empty directory as a placeholder for the submodule but
otherwise ignore it.  We were generating an error and stopping
the checkout.  This makes our behavior match that of core git.
2013-05-15 14:54:02 -07:00
Russell Belfer
55d3a39098 Remove old symlinks before updating
Unlike blob updates, symlink updates cannot be done "in place"
writing over an old symlink.  This means that in checkout when we
realize that we can safely update a symlink, we still need to
remove the old one before writing the new.
2013-05-15 14:52:12 -07:00
Russell Belfer
79ef3be449 Fix diff crash when last item is untracked dir
When the last item in a diff was an untracked directory that only
contained ignored items, the loop to scan the contents would run
off the end of the iterator and dereference a NULL pointer.  This
includes a test that reproduces the problem and a fix.
2013-05-15 14:50:05 -07:00
nulltoken
1fed6b07f0 Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
Jameson Miller
6fe02c11a6 Fetch should not fail when remote HEAD reference is not present locally 2013-05-15 14:44:35 -04:00
Brad Morgan
84ac625ddd Added GITERR_CHECK_ALLOC 2013-05-15 12:51:40 -04:00
Brad Morgan
a6b79b9bdc Changed case of FindLibSSH2.cmake to FindLIBSSH2.cmake 2013-05-15 12:49:15 -04:00
Brad Morgan
6cbbd73935 Renamed FindLibSSH2.cmake 2013-05-15 12:48:43 -04:00
Brad Morgan
ccaee222a1 Added GITERR_CHECK_ALLOC 2013-05-15 12:46:33 -04:00
Brad Morgan
e057e41122 Reworked git_cred_ssh_keyfile_passphrase_new method 2013-05-15 12:44:51 -04:00
Brad Morgan
b54ed3efe8 Added error check 2013-05-15 12:41:16 -04:00
Brad Morgan
22011b33da Cleanup 2013-05-15 12:38:40 -04:00
Vicent Marti
f0ab73720a signature: Lenient when dupping, strict when creating 2013-05-15 17:51:57 +02:00
Vicent Martí
86c6f74a79 Merge pull request #1583 from linquize/whitespace
Unify whitespaces to tabs
2013-05-15 08:31:37 -07:00
Linquize
0cb16fe924 Unify whitespaces to tabs 2013-05-15 20:26:55 +08:00
Russell Belfer
bc2020d648 Extend valgrind suppressions on Mac 2013-05-14 16:39:19 -07:00
Russell Belfer
00384321d3 Merge pull request #1580 from carlosmn/cmake-describe
CMake: vendor strings
2013-05-14 16:24:16 -07:00
Russell Belfer
33539b109c Merge pull request #1582 from dmgctrl/checkout_symlink_fix
Create directory for symlink before creating symlink
2013-05-14 15:05:52 -07:00
Russell Belfer
103a2c7727 Merge pull request #1581 from nulltoken/fix/leaks
Fix some memory leaks
2013-05-14 15:04:16 -07:00
Carlos Martín Nieto
3bbc87d697 CMake: allow appending a string to the library filename
This helps us install multiple versions of the library side-by-side.
2013-05-14 23:40:20 +02:00
Brad Morgan
fbcab44b20 Create directory for symlink before creating symlink 2013-05-14 16:03:09 -04:00
nulltoken
b4d33e46c4 Fix some memory leaks 2013-05-14 21:54:26 +02:00
Carlos Martín Nieto
000e68961c CMake: don't try to use bundled zlib when the system's path is in the cache
The code surrounding zlib bundling did not take into consideration
that ZLIB_LIBRARY gets cached, and assumed that FIND(ZLIB) would
always set ZLIB_FOUND, which does not hold true, as this variable
signifies that we have found the package and had to look at the
system, as its location was not cached.

Only use the bundled sources if the external zlib is neither
newly-found nor cached.
2013-05-12 15:35:02 +02:00
Carlos Martín Nieto
62221033a8 Merge pull request #1575 from arrbee/ref-iterator-early-exit
Fix refdb iteration early termination bug
2013-05-11 07:48:31 -07:00
Russell Belfer
99d32707b9 Fix refdb iteration early termination bug
There was a problem found in the Rugged test suite where the
refdb_fs_backend__next function could exit too early in some
very specific hashing patterns for packed refs.  This ports
the Rugged test to libgit2 and then fixes the bug.
2013-05-11 06:42:25 -07:00
Vicent Martí
7b5bc8f498 Merge pull request #1569 from linquize/msvc-sdl
Fix broken build when MSVC SDL checks is enabled
2013-05-11 05:15:00 -07:00
Linquize
e583334c00 Fix broken build when MSVC SDL checks is enabled 2013-05-11 20:13:26 +08:00
Edward Thomson
b6cc559a78 Merge pull request #1385 from carlosmn/refs-iter
Introduce a refs iterator
2013-05-11 02:42:49 -07:00
Carlos Martín Nieto
c58cac12c2 Introduce a glob-filtering iterator
If the backend doesn't provide support for it, the matching is done in
refdb on top of a normal iterator.
2013-05-11 11:20:38 +02:00
Carlos Martín Nieto
9bd89d9622 Move a couple more functions to use iterators 2013-05-11 11:20:38 +02:00
Carlos Martín Nieto
2b562c3a1e refs: remove the OID/SYMBOLIC filtering
Nobody should ever be using anything other than ALL at this level, so
remove the option altogether.

As part of this, git_reference_foreach_glob is now implemented in the
frontend using an iterator. Backends will later regain the ability of
doing the glob filtering in the backend.
2013-05-11 11:20:38 +02:00
Carlos Martín Nieto
95727245fd refs: implement _foreach with the iterator 2013-05-11 11:20:37 +02:00
Carlos Martín Nieto
932af0e9eb Add iterator support to the testdb backend 2013-05-11 11:20:37 +02:00
Carlos Martín Nieto
fb592a96eb Remove outdated test
Selecting wether to list loose or packed references is not something
we want to support anymore, so remove a test for this.
2013-05-11 11:20:37 +02:00
Carlos Martín Nieto
51fc5e895d Make sure the ref iterator works in an repo without physical presence 2013-05-11 11:20:37 +02:00
Carlos Martín Nieto
69a3c766b6 refdb_fs: don't crash when the repo doesn't have a path 2013-05-11 11:20:37 +02:00
Carlos Martín Nieto
4def7035ca refs: introduce an iterator
This allows us to get a list of reference names in a loop instead of callbacks.
2013-05-11 11:20:37 +02:00
Vicent Martí
4a65aead2c Merge pull request #1571 from arrbee/what-if-ignorecase-lies
Improve ignore handling in git_status_file
2013-05-10 10:49:22 -07:00
Vicent Martí
c3a5171198 Merge pull request #1572 from arrbee/diff-patch-with-rename
Fix diff output for renames and copies
2013-05-10 10:47:08 -07:00
Ben Straub
94d24ac93f Merge pull request #1573 from nulltoken/fix/leaks
Fix some memory leaks
2013-05-10 10:33:25 -07:00
nulltoken
249888948f Fix some memory leaks 2013-05-10 19:22:47 +02:00
Russell Belfer
e9ba61f399 Fix diff output for renames and copies
If you use rename detection, the renamed and copied files would
not show any text diffs because the function that decides if
data should be loaded didn't know which sides of the diff to
load for those cases.

This adds a test that looks at the patch generated for diff
entries that are COPIED or RENAMED.
2013-05-10 09:32:42 -07:00
Russell Belfer
1f9e41ee86 Improve ignore handling in git_status_file
The git_status_file API was doing a hack to deal with files that
are inside ignored directories.  The status scan was not reporting
any file in this case, so git_status_file would attempt a final
"stat()" call, and return IGNORED if the file actually existed.

On case-insensitive filesystems where core.ignorecase is set
incorrectly, this magic check can "succeed" and report a file
as ignored when it should actually return ENOTFOUND.

Now that we have the GIT_STATUS_OPT_RECURSE_IGNORED_DIRS, we can
use that flag to make sure that git_status_file() will look into
ignored directories and eliminate the hack completely, so we give
the correct error.
2013-05-10 07:50:53 -07:00
Brad Morgan
89ea0e5181 Removed ifdef 2013-05-10 09:40:14 -04:00
Michael Schubert
ae59321fb8 clone: fix -Wmaybe-uninitialized warning 2013-05-10 14:46:14 +02:00
Brad Morgan
b4d81a00bf Moved libssh2 sign callback into typedef 2013-05-09 17:40:21 -04:00
Brad Morgan
ce6d50b994 Changed to use libssh2_channel_exec 2013-05-09 17:37:42 -04:00
Brad Morgan
05f581311b Renaming 2013-05-09 17:36:27 -04:00