Commit Graph

3727 Commits

Author SHA1 Message Date
Vicent Martí
aa1c3b588e Merge pull request #1016 from arrbee/fix-checkout-dir-removal
Update checkout with new strategies & behavior
2012-11-13 14:13:47 -08:00
Vicent Marti
262274748f makefile: Fix the builtin Makefile 2012-11-13 14:05:43 -08:00
Carlos Martín Nieto
47db054df0 config: distinguish between a lone variable name and one without rhs
'[section] variable' and '[section] variable =' behave differently
when parsed as booleans, so we need to store that distinction
internally.
2012-11-13 13:53:41 -08:00
Carlos Martín Nieto
3ee078c0f7 config: rename get_config_entry -> config_entry
We're already in the git_config namespace, there is no need to repeat
it.
2012-11-13 13:46:17 -08:00
Vicent Martí
3741a37f5e Merge pull request #1055 from ethomson/sha1_win32
Win32 CryptoAPI and CNG support for SHA1
2012-11-13 13:28:08 -08:00
Vicent Martí
70572ff80b Merge pull request #1064 from libgit2/http-parser-2
Bump the builtin http-parser to v2.0
2012-11-13 13:26:04 -08:00
Edward Thomson
2a612fe3c3 filebuf now has a git_hash_ctx instead of a ctx* 2012-11-13 14:57:35 -06:00
Edward Thomson
a8527429dc unload dll / destroy hash ctxs at shutdown 2012-11-13 14:48:10 -06:00
Edward Thomson
7ebefd22e7 move hash library func ptrs to global global 2012-11-13 10:23:05 -06:00
Edward Thomson
603bee0791 Remove git_hash_ctx_new - callers now _ctx_init() 2012-11-13 10:23:05 -06:00
Edward Thomson
d6fb092409 Win32 CryptoAPI and CNG support for SHA1 2012-11-13 10:23:05 -06:00
Ben Straub
e45423dd2c Merge pull request #1065 from nulltoken/fix/memory-leak
Fix memory leaks
2012-11-13 05:45:08 -08:00
Michael Schubert
d51e54f1f4 Remove unused variables 2012-11-13 14:28:44 +01:00
nulltoken
4e547eee31 test: fix memory leak 2012-11-13 07:12:53 +01:00
nulltoken
3dee36557e local: fix memory leak 2012-11-13 07:04:30 +01:00
Vicent Marti
64ac9548aa Bump the builtin http-parser 2012-11-12 15:42:03 -08:00
Vicent Marti
9a50026b19 clar-helpers: Oops, grab pointer 2012-11-12 15:38:28 -08:00
Vicent Marti
19c044a17d Merge remote-tracking branch 'ben/local-transport' into development 2012-11-12 14:23:17 -08:00
Vicent Martí
3b44ced096 Merge pull request #1061 from nulltoken/topic/explicit-head-errors
repository: Refine repository_head() error report
2012-11-12 14:12:41 -08:00
Ben Straub
14157652ee Remove unnecessary progress logic
The indexer handles this better than the fetch
logic does.
2012-11-12 07:57:03 -08:00
Ben Straub
0f5520f73a Fix error check 2012-11-12 07:55:09 -08:00
nulltoken
b1a3a70ed1 repository: Refine repository_head() error report 2012-11-12 00:14:51 +01:00
nulltoken
ef8871515b Fix compilation warning 2012-11-12 00:13:02 +01:00
Edward Thomson
e090a5681b Merge pull request #1010 from ethomson/fetch_head
create FETCH_HEAD specially instead of as a ref file
2012-11-11 10:01:11 -08:00
Edward Thomson
b0f6e45d14 create FETCH_HEAD specially instead of as a ref file 2012-11-11 11:56:33 -06:00
Vicent Martí
d18713fb4a Merge pull request #1056 from nulltoken/duplicate-tree-entries
Duplicate tree entries
2012-11-10 20:24:53 -08:00
Vicent Martí
29c16698b2 Merge pull request #1060 from nulltoken/topic/explicit-index-errors
Topic/explicit index errors
2012-11-10 20:24:23 -08:00
nulltoken
95d73de15f index: prefer INDEX_OWNER usage 2012-11-10 21:10:49 +01:00
nulltoken
33f95a9b32 index: refine add_from_workdir() error report 2012-11-10 21:01:05 +01:00
nulltoken
69c068c79f index: make git_index_new() work with a NULL path 2012-11-10 20:42:45 +01:00
nulltoken
353e991679 tests: Add missing assertions 2012-11-10 16:43:05 +01:00
Ben Straub
2ff1a0d0f0 Helpers for local-filesystem remote URLs 2012-11-09 16:59:46 -08:00
Russell Belfer
757b406504 Fix warnings and valgrind issues
This fixes some various warnings that showed up in Travis and
a couple uses of uninitialized memory and one memory leak.
2012-11-09 14:01:44 -08:00
Russell Belfer
0f3def715d Fix various cross-platform build issues
This fixes a number of warnings and problems with cross-platform
builds.  Among other things, it's not safe to name a member of a
structure "strcmp" because that may be #defined.
2012-11-09 13:52:07 -08:00
Russell Belfer
8064ecba23 Update reset hard test
The `git_reset` API with the HARD option is still slightly
broken, but this test now does exercise the ability of the
command to revert modified files.
2012-11-09 13:52:07 -08:00
Russell Belfer
a1bf70e4c9 fix regression in diff with submodule oid 2012-11-09 13:52:07 -08:00
Russell Belfer
ad9a921b92 Rework checkout with new strategy options
This is a major reworking of checkout strategy options.  The
checkout code is now sensitive to the contents of the HEAD tree
and the new options allow you to update the working tree so that
it will match the index content only when it previously matched
the contents of the HEAD.  This allows you to, for example, to
distinguish between removing files that are in the HEAD but not
in the index, vs just removing all untracked files.

Because of various corner cases that arise, etc., this required
some additional capabilities in rmdir and other utility functions.

This includes the beginnings of an implementation of code to read
a partial tree into the index based on a pathspec, but that is
not enabled because of the possibility of creating conflicting
index entries.
2012-11-09 13:52:07 -08:00
Russell Belfer
55cbd05b18 Some diff refactorings to help code reuse
There are some diff functions that are useful in a rewritten
checkout and this lays some groundwork for that.  This contains
three main things:

1. Share the function diff uses to calculate the OID for a file
   in the working directory (now named `git_diff__oid_for_file`
2. Add a `git_diff__paired_foreach` function to iterator over
   two diff lists concurrently.  Convert status to use it.
3. Move all the string/prefix/index entry comparisons into
   function pointers inside the `git_diff_list` object so they
   can be switched between case sensitive and insensitive
   versions.  This makes them easier to reuse in various
   functions without replicating logic.  As part of this, move
   a couple of index functions out of diff.c and into index.c.
2012-11-09 13:52:07 -08:00
Russell Belfer
2e3d4b96c0 Move pathspec code in separate files
Diff uses a `git_strarray` of path specs to represent a subset
of all files to be processed.  It is useful to be able to reuse
this filtering in other places outside diff, so I've moved it
into a standalone set of utilities.
2012-11-09 13:52:07 -08:00
Russell Belfer
220d5a6c35 Make iterator ignore eval lazy
This makes it so that the check if a file is ignored will be
deferred until requested on the workdir iterator, instead of
aggressively evaluating the ignore rules for each entry.  This
should improve performance because there will be no need to
check ignore rules for files that are already in the index.
2012-11-09 13:52:07 -08:00
Russell Belfer
18eff2ad70 Clean up a couple things missed in rebase 2012-11-09 13:52:07 -08:00
Russell Belfer
32def5af9a Fix checkout behavior when its hands are tied
So, @nulltoken created a failing test case for checkout that
proved to be particularly daunting.  If checkout is given only
a very limited strategy mask (e.g. just GIT_CHECKOUT_CREATE_MISSING)
then it is possible for typechange/rename modifications to leave it
unable to complete the request.  That's okay, but the existing code
did not have enough information not to generate an error (at least
for tree/blob conflicts).

This led me to a significant reorganization of the code to handle
the failing case, but it has three benefits:

1. The test case is handled correctly (I think)
2. The new code should actually be much faster than the old code
   since I decided to make checkout aware of diff list internals.
3. The progress value accuracy is hugely increased since I added
   a fourth pass which calculates exactly what work needs to be
   done before doing anything.
2012-11-09 13:52:06 -08:00
Russell Belfer
331e7de900 Extensions to rmdir and mkdir utilities
* Rework GIT_DIRREMOVAL values to GIT_RMDIR flags, allowing
  combinations of flags
* Add GIT_RMDIR_EMPTY_PARENTS flag to remove parent dirs that
  are left empty after removal
* Add GIT_MKDIR_VERIFY_DIR to give an error if item is a file,
  not a dir (previously an EEXISTS error was ignored, even for
  files) and enable this flag for git_futils_mkpath2file call
* Improve accuracy of error messages from git_futils_mkdir
2012-11-09 13:52:06 -08:00
Vicent Martí
8a328cf442 Merge pull request #1058 from pwkelley/development
Fixes for two segfaults
2012-11-09 13:19:32 -08:00
Vicent Martí
39d7cf60de Merge pull request #1059 from nulltoken/fix/config-open-level
config: make git_config_open_level() work with an empty config
2012-11-09 13:15:57 -08:00
Philip Kelley
fcd03bebbf Fix a mutex/critical section leak 2012-11-09 15:57:32 -05:00
nulltoken
55f9837f11 config: make git_config_open_level() work with an empty config 2012-11-09 21:49:50 +01:00
Philip Kelley
2f683f0097 Fix uninitialized memory in winhttp subtransport on 64-bit 2012-11-09 15:39:25 -05:00
Philip Kelley
2364735c8f Fix implementation of strndup to not overrun 2012-11-09 15:39:10 -05:00
Ben Straub
90207709a3 Avoid copying duplicate commits 2012-11-09 10:33:16 -08:00