Commit Graph

673 Commits

Author SHA1 Message Date
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
Ben Straub
2508cc66eb Rename ref and reflog apis for consistency 2012-11-27 13:17:45 -08:00
nulltoken
b15df1d937 reflog: make entry_byindex() and drop() git compliant
Passing 0 as the index now retrieves the most recent entry instead
of the oldest one.
2012-11-17 18:30:35 -08:00
nulltoken
1a764476d2 reflog: Fix documentation 2012-11-17 18:30:34 -08:00
nulltoken
270160b91a config: Opening a nonexistent file returns ENOTFOUND 2012-11-17 18:30:34 -08:00
nulltoken
d36451c9d4 config: Make git_config_file__ondisk() internal 2012-11-17 12:34:15 -08:00
nulltoken
6091457e76 repo: ensure is_empty() checks there are no refs 2012-11-17 07:20:08 -08:00
nulltoken
aa8a76eff9 tag: rename git_tag_type to git_tag_target_type 2012-11-17 05:41:20 -08:00
Vicent Martí
4a0c7f56ab Merge pull request #1074 from edubart/ignore_diff_filemode
Add option to ignore file mode in diffs
2012-11-15 10:31:11 -08:00
Eduardo Bart
c0d5acf69a Add option to ignore file mode in diffs 2012-11-15 14:59:39 -02: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
5735bf5e6a Fix diff API to better parameter order
The diff API is not in the parameter order one would expect from
other libgit2 APIs.  This fixes that.
2012-11-14 22:54:31 -08:00
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
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
Edward Thomson
7ebefd22e7 move hash library func ptrs to global global 2012-11-13 10:23:05 -06:00
nulltoken
b1a3a70ed1 repository: Refine repository_head() error report 2012-11-12 00:14:51 +01: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
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
nulltoken
f92bcaea49 index: prevent tree creation from a non merged state
Fix libgit2/libgit2sharp#243
2012-11-09 16:45:47 +01:00
Brian Schroeder
b0b8065880 Update documentation in remote.h 2012-11-08 21:28:15 -08:00
nulltoken
7cc1bf0fcb index: Introduce git_index_has_conflicts() 2012-11-08 21:16:48 +01:00
Philip Kelley
9d64128325 Merge pull request #1048 from pwkelley/basic_auth
Basic authentication for http and winhttp
2012-11-08 08:06:23 -08:00
Philip Kelley
091361f569 Basic authentication for http and winhttp 2012-11-06 08:52:03 -05:00
Edward Thomson
09cc0b92dc create callback to handle packs from fetch, move the indexer to odb_pack 2012-11-05 16:00:29 -06:00
Vicent Martí
942a76983b Merge pull request #1034 from carlosmn/packbuilder-foreach
Let the user grab the packfile as it's being written
2012-11-05 06:54:34 -08:00
Vicent Martí
1362a98316 Merge pull request #1014 from arrbee/diff-rename-detection
Initial implementation of diff rename detection
2012-11-02 10:00:28 -07:00
Vicent Martí
d13da328e2 Merge pull request #1038 from arrbee/doc-fixes
Improve docs, examples, warnings
2012-11-01 14:18:40 -07:00
Russell Belfer
b90500f03d Improve docs, examples, warnings
This improves docs in some of the public header files, cleans
up and improves some of the example code, and fixes a couple
of pedantic warnings in places.
2012-11-01 14:08:30 -07:00
Vicent Marti
1e808f9cda index: Add git_index_new 2012-11-01 20:28:28 +01:00
Vicent Marti
276ea401b3 index: Add git_index_write_tree 2012-11-01 20:17:10 +01:00
Vicent Martí
7ae73e94db Merge pull request #1030 from pwkelley/transports
Reorganize transport architecture
2012-11-01 09:15:29 -07:00
Philip Kelley
41fb1ca0ec Reorganize transport architecture (squashed 3) 2012-11-01 09:02:33 -04:00
Carlos Martín Nieto
b4b935d8ab packbuilder: add accessors for the number of total and written objects 2012-11-01 06:21:49 +01:00
Carlos Martín Nieto
3dfed9cb86 packbuilder: add git_packbuilder_foreach
Let the user get each object as a buffer+size pair so they can handle
the packfile content as they need to.
2012-11-01 06:21:49 +01:00
Russell Belfer
744cc03e2b Add git_config_refresh() API to reload config
This adds a new API that allows users to reload the config if the
file has changed on disk.  A new config callback function to
refresh the config was added.

The modified time and file size are used to test if the file needs
to be reloaded (and are now stored in the disk backend object).

In writing tests, just using mtime was a problem / race, so I
wanted to check file size as well.  To support that, I extended
`git_futils_readbuffer_updated` to optionally check file size in
addition to mtime, and I added a new function `git_filebuf_stats`
to fetch the mtime and size for an open filebuf (so that the
config could be easily refreshed after a write).

Lastly, I moved some similar file checking code for attributes
into filebuf.  It is still only being used for attrs, but it
seems potentially reusable, so I thought I'd move it over.
2012-10-30 12:11:23 -07:00
Vicent Martí
efde422553 Merge pull request #1017 from arrbee/diff-patch-to-str
Add git_diff_patch_to_str API
2012-10-30 12:04:28 -07:00
Vicent Martí
c4a9ded0f9 Merge pull request #1026 from nulltoken/repo/state
repo: enhance git_repository_state() detection
2012-10-30 12:03:22 -07:00
Russell Belfer
db106d01f0 Move rename detection into new file
This improves the naming for the rename related functionality
moving it to be called `git_diff_find_similar()` and renaming
all the associated constants, etc. to make more sense.

I also moved the new code (plus the existing `git_diff_merge`)
into a new file `diff_tform.c` where I can put new functions
related to manipulating git diff lists.

This also updates the implementation significantly from the
last revision fixing some ordering issues (where break-rewrite
needs to be handled prior to copy and rename detection) and
improving config option handling.
2012-10-30 09:40:50 -07:00
Edward Thomson
f45ec1a076 index refactoring 2012-10-29 20:04:21 -05:00
nulltoken
31966d20e3 repo: enhance git_repository_state() detection 2012-10-27 16:45:59 +02:00
nulltoken
e4c64cf2aa stash: add git_stash_drop() 2012-10-26 22:11:15 +02:00
nulltoken
233884131d stash: add git_stash_foreach() 2012-10-26 22:11:09 +02:00
nulltoken
590fb68be0 stash: add git_stash_save() 2012-10-26 22:10:48 +02:00
nulltoken
eb44cfe07b error: add GITERR_STASH error type 2012-10-26 21:02:06 +02:00
nulltoken
b1be9dd0e5 index: introduce git_index_owner() 2012-10-26 21:02:04 +02:00
nulltoken
f7ae3f7531 reflog: fix documentation typos 2012-10-26 21:01:59 +02:00
Russell Belfer
cb7180a6e2 Add git_diff_patch_print
This adds a `git_diff_patch_print()` API which is more like the
existing API to "print" a patch from an entire `git_diff_list`
but operates on a single `git_diff_patch` object.

Also, it rewrites the `git_diff_patch_to_str()` API to use that
function (making it very small).
2012-10-25 11:48:39 -07:00
Russell Belfer
1b9346897b Merge pull request #925 from nulltoken/topic/moving-branch-updates-config
Updates config upon moving and deletion of branches
2012-10-25 10:55:03 -07:00