Commit Graph

27 Commits

Author SHA1 Message Date
Ben Straub
bde336ea51 Add version fields and init macros for public input structs. 2012-11-30 12:55:45 -08:00
Vicent Marti
cfbe4be3fb More external API cleanup
Conflicts:
	src/branch.c
	tests-clar/refs/branches/create.c
2012-11-27 13:18:27 -08:00
Russell Belfer
bbe6dbec81 Add explicit git_index ptr to diff and checkout
A number of diff APIs and the `git_checkout_index` API take a
`git_repository` object an operate on the index.  This updates
them to take a `git_index` pointer explicitly and only fall back
on the `git_repository` index if the index input is NULL.  This
makes it easier to operate on a temporary index.
2012-11-14 23:29:48 -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
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
Ben Straub
9c05c17b7a Checkout progress now reports completed/total steps 2012-10-19 20:05:18 -07:00
Ben Straub
806426565f Convert checkout_* to use progress callback 2012-10-19 19:36:21 -07:00
Ben Straub
2c8bbb27d9 Convert checkout_index to use progress callback 2012-10-19 19:34:15 -07:00
nulltoken
8b05bea870 errors: deploy GIT_EORPHANEDHEAD usage 2012-10-19 22:01:53 +02:00
Russell Belfer
4c47a8bcfe Merge pull request #968 from arrbee/diff-support-typechange
Support TYPECHANGE records in status and adjust checkout accordingly
2012-10-17 14:14:51 -07:00
Paul Thompson
b46708aaf9 Separated git_strarray from common.h. Added doxy comments. 2012-10-11 23:04:08 +11:00
Russell Belfer
fe67e404da Move enum comments next to actual values 2012-10-09 14:35:24 -07:00
Russell Belfer
0d64bef941 Add complex checkout test and then fix checkout
This started as a complex new test for checkout going through the
"typechanges" test repository, but that revealed numerous issues
with checkout, including:

* complete failure with submodules
* failure to create blobs with exec bits
* problems when replacing a tree with a blob because the tree
  "example/" sorts after the blob "example" so the delete was
  being processed after the single file blob was created

This fixes most of those problems and includes a number of other
minor changes that made it easier to do that, including improving
the TYPECHANGE support in diff/status, etc.
2012-10-09 11:59:34 -07:00
nulltoken
9e592583fc checkout: add notification callback for skipped files 2012-09-21 08:08:29 +02:00
nulltoken
397837197d checkout: Mimic git_diff_options storage of paths 2012-09-17 20:27:28 +02:00
nulltoken
5af61863dd checkout: drop git_checkout_reference() 2012-09-17 10:48:30 +02:00
nulltoken
c214fa1caf checkout: segregate checkout strategies 2012-09-17 10:48:30 +02:00
nulltoken
e93af30411 checkout: introduce git_checkout_index() 2012-09-17 10:48:27 +02:00
nulltoken
3aa443a951 checkout: introduce git_checkout_tree() 2012-09-17 10:48:26 +02:00
nulltoken
746642a6b3 checkout: fix documentation code alignment 2012-09-06 18:40:08 +02:00
Ben Straub
5280f4e698 Add checkout.h to git2.h.
Also correcting some documentation strings.
2012-07-31 19:39:06 -07:00
Ben Straub
b31667fb69 Checkout: add head- and ref-centric checkouts.
Renamed git_checkout_index to what it really was,
and removed duplicate code from clone.c. Added
git_checkout_ref, which updates HEAD and hands off
to git_checkout_head.

Added tests for the options the caller can pass to
git_checkout_*.
2012-07-27 20:31:05 -07:00
Ben Straub
095ccc013f Checkout: implementation of most options 2012-07-26 16:31:49 -07:00
Ben Straub
b401bace1b Restructure for better checkout options
* Removed the #define for defaults
* Promoted progress structure to top-level API call
  argument
2012-07-26 13:12:21 -07:00
Ben Straub
ef9905c990 checkout: introduce git_checkout_opts
Refactor checkout into several more-sensible
entry points, which consolidates common options
into a single structure that may be passed around.
2012-07-26 12:58:44 -07:00
Ben Straub
deac801de9 Fix documentation comment to match actual params. 2012-07-13 15:50:23 -07:00
Ben Straub
14741d62d9 Clone: new home for git_checkout_force. 2012-06-21 11:13:19 -07:00