Commit Graph

2720 Commits

Author SHA1 Message Date
Sebastian Bauer
e9bb730c36 Added missing curly brackets and fixed compiler warnings. 2013-01-10 09:16:14 +01:00
Ben Straub
520dcc1c00 Move credential helpers to their own (optional) header 2013-01-09 13:31:17 -08:00
Ben Straub
ffb02b1630 Expose stock user/pass credential utility 2013-01-09 13:31:17 -08:00
Michael Schubert
abeefbbe18 push: properly handle tags
Currently, push doesn't really handle tags when queueing objects. Fix
it.
2013-01-09 17:05:21 +01:00
Jameson Miller
087f64d3e3 Relax refspecs accepted by push 2013-01-09 16:15:58 +01:00
Russell Belfer
de59055017 Resolve crash with diff against empty file
It is not legal inside our `p_mmap` function to mmap a zero length
file.  This adds a test that exercises that case inside diff and
fixes the code path where we would try to do that.

The fix turns out not to be a lot of code since our default file
content is already initialized to "" which works in this case.

Fixes #1210
2013-01-08 17:11:11 -08:00
Edward Thomson
359fc2d241 update copyrights 2013-01-08 17:31:27 -06:00
Edward Thomson
8f09f46498 remove ppc sha1 asm 2013-01-08 16:55:16 -06:00
Russell Belfer
f2b7f7a6cb Share git_diff_blobs/git_diff_blob_to_buffer code
This moves the implementation of these two APIs into common code
that will be shared between the two.  Also, this adds tests for
the `git_diff_blob_to_buffer` API.  Lastly, this adds some extra
`const` to a few places that can use it.
2013-01-07 15:44:22 -08:00
Ignacio Casal Quinteiro
f6234cd994 Introduce git_diff_blob_to_buffer 2013-01-07 14:13:18 -08:00
Philip Kelley
f6ed5e2d05 Revert changes from git/git diff-delta.c by dak@gnu.org, proski@gnu.org 2013-01-07 09:53:43 -05:00
Edward Thomson
c31ae146b4 merge cleanup should actually cleanup and the test should actually test 2013-01-06 18:38:29 -06:00
Vicent Martí
5df7ad3ece Merge pull request #1196 from scunz/allow_clone_without_master_branch
Allow to clone repositories that don't have a `master` branch
2013-01-06 07:56:45 -08:00
Vicent Martí
74f880a639 Merge pull request #1197 from nulltoken/travis/run-online-tests
travis: Include the online suite when running against Travis
2013-01-06 07:56:08 -08:00
nulltoken
d01fe38061 reset: Fix a memory leak 2013-01-06 16:22:28 +01:00
nulltoken
d1aee4775a clone: Fix a memory leak 2013-01-06 15:09:27 +01:00
Sascha Cunz
2ba6f3c7f1 Allow to clone repositories that don't have a master branch
Before this, we error out from `reference_matches_remote_head` if the
reference we're searching for does not exist.
Since we explicitly check if master is existing in `update_head_to_remote`
and error out if it doesn't, a repository without master branch could
not be cloned.
In fact this was later clobbered by what is fixed in #1194.

However, this patch introduces a `found` member in `head_info` and sets
it accordingly. That also saves us from checking the string length of
`branchname` a few times.
2013-01-06 14:30:52 +01:00
Scott J. Goldman
f9b55bcb5f git_mwindow_file_deregister() shouldn't return errors
As a function that appears to only be called on error paths, I don't
think it makes sense for it to return an error, or clobber the global
giterr. Note that no existing callsites actually check the return
code.

In my own application, there are errors where the real error ends
up being hidden, as git_mwindow_file_deregister() clobbers the
global giterr. I'm not sure this error is even relevant?
2013-01-05 18:27:24 -08:00
Vicent Martí
d74b1bc529 Merge pull request #1131 from libgit2/correct-ahead-behind
Fix an issue with ahead-behind for lopsided traversal
2013-01-05 15:44:19 -08:00
Scott J. Goldman
ef82ff30f6 Handle packed refs with no trailing newline
I saw a repo in the wild today which had a master branch ref which was packed, but had no trailing newline. Git handled it fine, but libgit2 choked on it. Fix seems simple enough. If we don't see a newline, assume the end of the buffer is the end of the ref line.
2013-01-05 00:46:39 -08:00
Maxwell Swadling
79ff264e2f Fixed size_t format string warning 2013-01-05 11:34:19 +11:00
Russell Belfer
817d625161 Fix checkout of index-only dirs and prefixed paths
There are a couple of checkout bugs fixed here.  One is with
untracked working directory entries that are prefixes of tree
entries but not in a meaningful way (i.e. "read" is a prefix of
"readme.txt" but doesn't interfere in any way).  The second bug
is actually a redo of 07edfa0fc640f85f95507c3101e77accd7d2bf0d
where directory entries in the index that are not in the diff
were not being removed correctly.  That fix remedied one case
but broke another.
2013-01-04 15:47:44 -08:00
Russell Belfer
7fc0043582 Add index API to remove all files in a directory
This adds the git_index_remove_directory API plus tests.
2013-01-04 15:47:44 -08:00
Russell Belfer
1b88faf7ae Fix oid tostr issue with NULL oid
I made a small change to the behavior of this code and apparently
got it wrong. Sigh.
2013-01-04 15:47:44 -08:00
Russell Belfer
d8889d2b64 Fix checkout bug rmv untracked trees from index
When checking out with the GIT_CHECKOUT_REMOVE_UNTRACKED option
and there was an entire tree in the working directory and in the
index that is not in the baseline nor target commit, the tree was
correctly(?) removed from the working directory but was not
successfully removed from the index.  This fixes that and adds a
test of the functionality.
2013-01-04 15:47:44 -08:00
Russell Belfer
dde7602ae6 Fix memory leak with checkout tree iterator 2013-01-04 15:47:44 -08:00
Russell Belfer
0d70f65051 Fixing checkout UPDATE_ONLY and adding tests
This adds a bunch of new checkout tests and in the process I found
a bug in the GIT_CHECKOUT_UPDATE_ONLY flag which I fixed.
2013-01-04 15:47:44 -08:00
Russell Belfer
2850252af7 Oh yeah, bugs from my rebase 2013-01-04 15:47:44 -08:00
Russell Belfer
77cffa31db Simplify checkout documentation
This moves a lot of the detailed checkout documentation into a new
file (docs/checkout-internals.md) and simplifies the public docs
for the checkout API.
2013-01-04 15:47:43 -08:00
Russell Belfer
e0548c0ea4 Fix some submodule and typechange checkout cases
There were a bunch of small bugs in the checkout code where I was
assuming that a typechange was always from a tree to a blob or
vice versa.  This fixes up most of those cases.  Also, there were
circumstances where the submodule definitions were changed by the
checkout and the submodule data was not getting reloaded properly
before the new submodules were checked out.
2013-01-04 15:47:43 -08:00
Russell Belfer
16a666d3d4 Fix workdir notifications and removals
The notifications were broken from the various iterations over
this code and were not returning working dir item data correctly.
Also, workdir items that were alphabetically after the last item
in diff were not being processed.
2013-01-04 15:47:43 -08:00
Russell Belfer
546d65a8da Fix up spoolandsort iterator usage
The spoolandsort iterator changes got sort-of cherry picked out of
this branch and so I dropped the commit when rebasing; however,
there were a few small changes that got dropped as well (since the
version merged upstream wasn't quite the same as what I dropped).
2013-01-04 15:47:43 -08:00
Russell Belfer
a9a730075e Submodule caching fix and location API
This adds a new API to the submodule interface that just returns
where information about the submodule was found (e.g. config file
only or in the HEAD, index, or working directory).

Also, the old "refresh" call was potentially keeping some stale
submodule data around, so this simplfies that code and literally
discards the old cache, then reallocates.
2013-01-04 15:47:43 -08:00
Russell Belfer
6f58332f3a Fix use of uninitialized variable 2013-01-04 15:47:43 -08:00
Russell Belfer
a6a82e1a59 Improve error propagation in stash
Stash was sometimes obscuring the actual error code, replacing it
with a -1 when there was more descriptive value.  This updates
stash to preserve the original error code more reliably along
with a variety of other error handling tweaks.

I believe this is an improvement, but arguably, preserving the
underlying error code may result in values that are harder to
interpret by the caller who does not understand the internals.
Discussion is welcome!
2013-01-04 15:47:42 -08:00
Russell Belfer
8fe713ccf7 Make git_oid_tostr use out buffer for NULL oid
Previously a NULL oid was handled like an empty buffer and
returned a status empty string.  This makes git_oid_tostr()
set the output buffer to the empty string instead.
2013-01-04 15:47:42 -08:00
Russell Belfer
5cf9875a4f Add index updating to checkout
Make checkout update entries in the index for all files that are
updated and/or removed, unless flag GIT_CHECKOUT_DONT_UPDATE_INDEX
is given.  To do this, iterators were extended to allow a little
more introspection into the index being iterated over, etc.
2013-01-04 15:47:42 -08:00
Russell Belfer
7e5c8a5b41 More checkout improvements
This flips checkout back to be driven off the changes between
the baseline and the target trees.  This reinstates the complex
code for tracking the contents of the working directory, but
overall, I think the resulting logic is easier to follow.
2013-01-04 15:47:42 -08:00
Russell Belfer
cf20803170 Rework checkout internals (again)
I've tried to map out the detailed behaviors of checkout and make
sure that we're handling the various cases correctly, along with
providing options to allow us to emulate "git checkout" and "git
checkout-index" with the various flags.  I've thrown away flags
in the checkout API that seemed like clutter and added some new
ones.  Also, I've converted the conflict callback to a general
notification callback so we can emulate "git checkout" output and
display "dirty" files.

As of this commit, the new behavior is not working 100% but some
of that is probably baked into tests that are not testing the
right thing.  This is a decent snapshot point, I think, along the
way to getting the update done.
2013-01-04 15:47:42 -08:00
Russell Belfer
bfe7d7de22 Reorder operations in git reset
This corrects the order of operations in git reset so that the
checkout to reset the working directory content is done before
the HEAD is moved.  This allows us to use the HEAD and the index
content to know what files can / should safely be reset.

Unfortunately, there are still some cases where the behavior of
this revision differs from core git.  Notable, a file which has
been added to the index but is not present in the HEAD is
considered to be tracked by core git (and thus removable by a
reset command) whereas since this loads the target state into
the index prior to resetting, it will consider such a file to be
untracked and won't touch it.  That is a larger fix that I'll
defer to a future commit.
2013-01-04 15:47:42 -08:00
Russell Belfer
6fee906c98 missing error message is confusing 2013-01-04 15:23:47 -08:00
Russell Belfer
6ac724afbe Clear error to avoid leaving invalid error behind 2013-01-04 15:23:47 -08:00
Vicent Martí
c18a5ec58c Merge pull request #1174 from nulltoken/topic/soft_reset_with_index_conflicts
Prevent soft reset when index contains conflicts
2013-01-04 11:10:39 -08:00
Philip Kelley
27fe6efe85 Fix git_index sorting with core.ignorecase in git_index_read 2013-01-04 13:48:08 -05:00
nulltoken
9a0d590412 reset: Cannot soft reset with a conflicted index 2013-01-04 18:43:34 +01:00
Vicent Martí
686a243a73 Merge pull request #1184 from ethomson/mergehead_iterator
MERGE_HEAD contents iterator
2013-01-04 08:36:13 -08:00
Philip Kelley
37955f5401 Merge pull request #1183 from congyiwu/push_delete_fix
Fix bug in gen_pktline() for deletes of missing remote refs
2013-01-04 07:33:31 -08:00
Edward Thomson
42e50b5ed1 MERGE_HEAD contents iterator 2013-01-03 16:35:59 -06:00
Martin Woodward
1c5b3a4185 Give proper license notice to code from Android
The usage of the Android derrived code contains a full notice
which must be provided with the source code as per the terms
given at:
https://android.googlesource.com/platform/bionic/+/android-4.0.3_r1.1/libc/bionic/dirname_r.c
2013-01-03 22:28:59 +00:00
Martin Woodward
0470f8fc9d Add full license notice to bsearch code
The original BSD glibc code contains the notice as given at
http://opensource.apple.com/source/gcc/gcc-5666.3/libiberty/bsearch.c
and should be given in full along with the code.
2013-01-03 22:24:10 +00:00
Congyi Wu
4128f5aa31 Fix bug in gen_pktline() for deletes of missing remote refs
* gen_pktline() in smart_protocol.c was skipping refspecs that deleted
  refs that were not advertised by the server.  The new behavior is to
  send a delete command with an old-id of zero, which matches the behavior
  of the official git client.
* Update test_network_push__delete() in reaction to above fix.
* Obviate messy logic that handles missing push_spec rrefs by canonicalizing
  push_spec.  After calculate_work(), loid, roid, and rref, are filled in with
  exactly what is sent to the server
2013-01-03 17:19:55 -05:00
Martin Woodward
9a919301c6 Add Apache license header back to libpqueue files
The original libpqueue file were licensed under Apache 2.0 so
therefore should retain their copyrights and header as per the
license terms at http://www.apache.org/licenses/LICENSE-2.0
2013-01-03 22:16:37 +00:00
Edward Thomson
ad2bc32fa3 expose merge metadata cleanup 2013-01-03 15:53:50 -06:00
Vicent Martí
07871d3adc Merge pull request #1181 from nvloff/allow_note_overwrite
Allow note overwrite
2013-01-03 07:43:27 -08:00
Nikolai Vladimirov
8716b499e2 add option to allow git note overwrite 2013-01-03 16:31:36 +02:00
Philip Kelley
0db4cd04ef Fix git__strncasecmp 2013-01-03 08:45:09 -05:00
Nikolai Vladimirov
4a44087ae7 notes.c - whitespace fix 2013-01-03 15:43:51 +02:00
Vicent Martí
cd5ca5b97f Merge pull request #1152 from ben/clone-api-structification
Segregate in-memory and persisted remotes
2013-01-02 13:50:41 -08:00
Ben Straub
730df6d0f7 Include checkout options inline 2013-01-02 13:43:54 -08:00
Ben Straub
c07b52df1b Remove inmem flag, use NULL name instead 2013-01-02 12:48:17 -08:00
Ben Straub
0642c1431e Move url to last place in parameter list 2013-01-02 12:44:47 -08:00
Michael Schubert
2e40c616c7 path: ifdef GIT_WIN32 looks_like_network_computer_name() 2013-01-02 16:28:08 +01:00
Russell Belfer
3865f7f661 Invalid ref name normalization leaked memory
When normalizing a reference name, if there is an error because
the name is invalid, then the memory allocated for storing the
name could be leaked if the caller was not careful and assumed
that the error return code meant that no allocation had occurred.

This fixes that by explicitly deallocating the reference name
buffer if there is an error in normalizing the name.
2012-12-27 23:23:12 -08:00
Russell Belfer
f616a36bdd Make spoolandsort a pushable iterator behavior
An earlier change to `git_diff_from_iterators` introduced a
memory leak where the allocated spoolandsort iterator was not
returned to the caller and thus not freed.

One proposal changes all iterator APIs to use git_iterator** so
we can reallocate the iterator at will, but that seems unexpected.
This commit makes it so that an iterator can be changed in place.
The callbacks are isolated in a separate structure and a pointer
to that structure can be reassigned by the spoolandsort extension.

This means that spoolandsort doesn't create a new iterator; it
just allocates a new block of callbacks (along with space for its
own extra data) and swaps that into the iterator.

Additionally, since spoolandsort is only needed to switch the
case sensitivity of an iterator, this simplifies the API to only
take the ignore_case boolean and to be a no-op if the iterator
already matches the requested case sensitivity.
2012-12-27 22:25:52 -08:00
Ben Straub
592f466c48 Fix GCC static/non-static compile error 2012-12-27 11:11:53 -08:00
nulltoken
50a762a563 path: Teach UNC paths to git_path_dirname_r()
Fix libgit2/libgit2sharp#256
2012-12-26 23:07:25 +01:00
nulltoken
f19304d265 remote: Prevent create() from blindly overwriting 2012-12-24 18:18:31 +01:00
nulltoken
7d4b65f608 Fix indentations 2012-12-24 16:54:27 +01:00
Michael Schubert
7382551ff7 Fix -Wmaybe-uninitialized warning 2012-12-22 16:29:59 +01:00
Vicent Martí
2052e3c071 Merge pull request #1163 from barrbrain/check-exists-before-write
odb: check if object exists before writing
2012-12-21 10:32:23 -08:00
Ben Straub
79000951ec In-memory remotes don't have names 2012-12-21 08:05:59 -08:00
David Michael Barr
4d185dd9b0 odb: check if object exists before writing
Update the procondition of git_odb_backend::write.
It may now be assumed that the object has already been hashed.
2012-12-21 13:05:20 +11:00
Ben Straub
87bc689fbf git_remote_create calls git_remote_save 2012-12-20 15:50:33 -08:00
Ben Straub
874dcb25eb Remote: deprecate dangling, prevent saving in-memory 2012-12-20 12:01:13 -08:00
Ben Straub
29f27599ea Rename remote creation APIs
git_remote_add -> git_remote_create
git_remote_new -> git_remote_create_inmemory
2012-12-20 10:52:57 -08:00
Ben Straub
00998a12ca Initialize variable 2012-12-19 17:02:06 -08:00
Ben Straub
621b50e4d5 Clone: trust but verify 2012-12-19 17:02:06 -08:00
Ben Straub
b412d56389 Add more clone options. Push test suite segfaults. 2012-12-19 17:02:06 -08:00
Edward Thomson
7fcec83428 fetchhead reading/iterating 2012-12-19 16:57:30 -06:00
Vicent Martí
5c3c86b06e Merge pull request #1150 from schu/fix-netops-ssl
netops: on SSL teardown only send shutdown alert
2012-12-19 13:43:50 -08:00
Vicent Marti
08a325a321 reflog: Actual error handling 2012-12-19 12:52:14 +01:00
Vicent Marti
8a810441a2 reflog: Rename error handling 2012-12-19 12:48:12 +01:00
Rick Bradley
9ec50c25a8 Make goto cleanup more consistent
There may be some question about whether this is likely to be needed
at all, but that's above my head at the moment.
2012-12-18 18:15:21 -06:00
Rick Bradley
3a6420f378 don't deref before we've asserted
just sayin'.
2012-12-18 17:46:18 -06:00
Rick Bradley
ed4e887d1a Also, whitespace.
I was totally flaunting @ben's 3-space tab advice.
2012-12-18 16:09:57 -06:00
Rick Bradley
33f169e24e Improve comment text
This looked wrong to me.  I *think* this is more appropriate
commentary.
2012-12-18 16:07:18 -06:00
Vicent Martí
e62171e2fc Merge pull request #1151 from arrbee/fix-diff-constructor-names
Fix diff constructor names
2012-12-17 11:10:25 -08:00
Russell Belfer
56c72b759c Fix diff constructor name order confusion
The diff constructor functions had some confusing names, where the
"old" side of the diff was coming after the "new" side.  This
reverses the order in the function name to make it less confusing.

Specifically...

* git_diff_index_to_tree becomes git_diff_tree_to_index
* git_diff_workdir_to_index becomes git_diff_index_to_workdir
* git_diff_workdir_to_tree becomes git_diff_tree_to_workdir
2012-12-17 11:00:53 -08:00
Michael Schubert
f2b00cbdf6 netops: on SSL teardown only send shutdown alert
According to man 3 SSL_shutdown / TLS, "If a unidirectional shutdown is
enough (the underlying connection shall be closed anyway), this first
call to SSL_shutdown() is sufficient."

Currently, an unidirectional shutdown is enough, since
gitno_ssl_teardown is called by gitno_close only. Do so to avoid further
errors (by misbehaving peers for example).

Fixes #1129.
2012-12-17 19:46:27 +01:00
Michael Schubert
9c8dbc8893 netops: properly handle GITNO_CONNECT_SSL_NO_CHECK_CERT
Don't return an error just because GITNO_CONNECT_SSL_NO_CHECK_CERT is
set.
2012-12-17 19:32:15 +01:00
Vicent Martí
0d10e79dd9 Merge pull request #1149 from nulltoken/topic/blob_isbinary
Introduce git_blob_is_binary()
2012-12-17 10:13:36 -08:00
nulltoken
a3337f10bb blob: introduce git_blob_is_binary() 2012-12-17 17:20:31 +01:00
nulltoken
bdb94c21fd Fix MSVC compilation warnings 2012-12-17 17:16:32 +01:00
Michael Schubert
101659be5d Fix -Wmaybe-uninitialized warning 2012-12-17 15:50:12 +01:00
Ben Straub
2a2d1ab086 Cloning empty repos: only allow missing target for HEAD 2012-12-15 14:30:20 -08:00
Ben Straub
28abb187c4 Stop returning incorrect error message 2012-12-14 14:16:10 -08:00
Ben Straub
b524fe1a3c Local Only ignore ENOTFOUNDs when adding corrupted refs 2012-12-14 13:58:44 -08:00
Ben Straub
850b1edfe8 Allow clone to handle empty repos 2012-12-14 13:58:44 -08:00
Ben Straub
b9e7e2b4e1 Move non-options back out of options struct 2012-12-14 13:46:45 -08:00
Ben Straub
18b2d560d3 Deploy git_clone_options; remove git_clone_bare 2012-12-14 13:03:59 -08:00
Vicent Marti
b0b9fd3245 Merge remote-tracking branch 'origin/clone-auth' into development 2012-12-14 02:41:53 +01:00
Jameson Miller
f0a2def5e4 Fix comment so it doesn't go over 100 chars 2012-12-13 18:08:45 -05:00
Jameson Miller
cb2ace69f4 Transport resolution on Win32 should handle absolute local paths 2012-12-13 14:42:40 -05:00
Ben Straub
24393ea6d3 Stop premature remote freeing when cloning 2012-12-13 09:14:56 -08:00
Ben Straub
7c353afd0e Define constant for default fetch spec 2012-12-13 08:47:29 -08:00
Ben Straub
44f36f6e3b Convert clone to use dangling remotes 2012-12-12 19:48:44 -08:00
Edward Thomson
e759b07217 don't walk off the end of the index 2012-12-12 17:54:12 -06:00
Ben Straub
b914e17d82 API to set a dangling remote's repository 2012-12-12 12:23:24 -08:00
Ben Straub
a71c27ccda Allow creation of dangling remotes 2012-12-12 12:15:25 -08:00
Nguyễn Thái Ngọc Duy
08f3d6caf4 tree cache: loosen negative entry count check
While C Git has been writing entry count -1 (ie. never other negative
numbers) as invalid since day 1, it accepts all negative entry counts
as invalid. JGit follows the same rule. libgit2 should also follow, or
the index that works with C Git or JGit may someday be rejected by
libgit2.

Other reimplementations like dulwich and grit have not bothered with
parsing or writing tree cache.
2012-12-12 19:23:05 +07:00
Russell Belfer
91e7d26303 Fix iterator reset and add reset ranges
The `git_iterator_reset` command has not been working in all cases
particularly when there is a start and end range.  This fixes it
and adds tests for it, and also extends it with the ability to
update the start/end range strings when an iterator is reset.
2012-12-10 15:38:41 -08:00
Russell Belfer
9950d27ab6 Clean up iterator APIs
This removes the need to explicitly pass the repo into iterators
where the repo is implied by the other parameters.  This moves
the repo to be owned by the parent struct.  Also, this has some
iterator related updates to the internal diff API to lay the
groundwork for checkout improvements.
2012-12-10 15:38:28 -08:00
Ben Straub
4cbe9a1be1 Add git_cred_acquire_cb payload to winhttp transport 2012-12-10 11:48:20 -08:00
Ben Straub
59bccf33c4 Add a payload param to git_cred_acquire_cb
Fixes #1128.
2012-12-10 11:11:01 -08:00
Vicent Martí
22bcf86c5a Merge pull request #1126 from carlosmn/indexer-buffer
indexer: move the temporary buffers into the indexer object
2012-12-10 06:55:59 -08:00
Scott J. Goldman
7d26c410bf Fix a bunch of leaks, error handling cases 2012-12-09 21:55:51 -08:00
Scott J. Goldman
e51c8b99be Fix mark_parents() to account for bad luck traversals
If commit timestamps are off, we're more likely to hit a traversal
where the first path ends up traversing past the root commit of the tree.
If that happens, it's possible that the loop will complete before the second
path marks some of those final parents. This fix keeps track of the root
nodes that are encountered in the traversal, and verify that they are
properly marked.

In the best case, with accurate timestamps, the traversal will continue
to terminate when all the commits are STALE (parents of a merge-base), as
it did before. In the worst case, where one path makes a complete traversal
past a root commit, we will continue the loop until the root commit itself
is marked.
2012-12-09 21:24:47 -08:00
Scott J. Goldman
9c2a4e8c47 Morph copy of git_merge__bases_many() -> mark_parents()
Integrate mark_parents() with the ahead_behind() code.
2012-12-09 21:01:46 -08:00
Scott J. Goldman
a3a81ae542 Copy git_merge__bases_many() for new ahead-behind code
To be used as a basis for a function which marks nodes with parents
up to the merge base.
2012-12-09 20:43:26 -08:00
Justin Spahr-Summers
1d00960334 orite C89 2012-12-09 02:40:16 -08:00
Justin Spahr-Summers
2bb1c7aa26 Treat git_mutex_lock as successful when threads are disabled 2012-12-09 02:37:33 -08:00
Justin Spahr-Summers
a35b386458 Always check the result of git_mutex_lock 2012-12-09 02:31:39 -08:00
Justin Spahr-Summers
c3320aca76 git__mwindow_mutex needs to be initialized even with pthreads
This could also use PTHREAD_MUTEX_INITIALIZER, but a dynamic initializer seems like a more portable concept, and we won't need another #define on top of git_mutex_init()
2012-12-09 02:22:50 -08:00
Carlos Martín Nieto
6481a68d49 indexer: move the temporary buffers into the indexer object
Storing 4kB or 8kB in the stack is not very gentle. As this part has
to be linear, put the buffer into the indexer object so we allocate it
once in the heap.
2012-12-07 19:24:55 +01:00
Vicent Martí
0249a5032e Merge pull request #1091 from carlosmn/stream-object
Indexer speedup with large objects
2012-12-07 09:40:21 -08:00
Carlos Martín Nieto
f1c75b94a1 tree: relax the filemode parser
There are many different broken filemodes in the wild so we need to
protect against them and give something useful up the chain. Don't
fail when reading a tree from the ODB but normalize the mode as best
we can.

As 664 is no longer a mode that we consider to be valid and gets
normalized to 644, we can stop accepting it in the treebuilder. The
library won't expose it to the user, so any invalid modes are a bug.
2012-12-07 16:59:18 +01:00
Russell Belfer
32770c52a8 Fix diff header comments and missing const
Based on the recent work to wrap diff in objective-git, this
includes a fix for a missing const and a number of clarifications
of the documentation.
2012-12-05 13:56:32 -08:00
Vicent Marti
bf192cdb43 versions: MSVC build fixes 2012-12-05 20:56:27 +01:00
Vicent Marti
43efaabd40 common: Silly vmg. 2012-12-05 20:54:03 +01:00
Vicent Marti
8ff66112d9 common: Silly MSVC 2012-12-05 20:50:19 +01:00
Vicent Martí
e05ca13f1f Merge pull request #1115 from ben/struct-versions
Version info for public structs
2012-12-05 11:47:19 -08:00
Edward Thomson
05fc823fce indentation fix 2012-12-04 16:59:34 -06:00
Edward Thomson
aab8f5af4b hey don't stomp on my memory! 2012-12-04 16:40:09 -06:00
Edward Thomson
b241466133 status should ignore conflicts entries in the index 2012-12-03 14:51:39 -06:00
Ben Straub
ee1c33b146 Don't unconstify when casting 2012-12-03 12:45:15 -08:00
Ben Straub
de70aea6b1 Remove GIT_SIGNATURE_VERSION and friends 2012-12-03 12:41:50 -08:00
Vicent Martí
3368c520dc Merge pull request #1112 from barrbrain/odb-pack-read-header
odb-pack: resurrect pack_backend__read_header
2012-12-03 07:38:58 -08:00
Vicent Marti
7ea3a79f0c Vade retro satana 2012-12-03 16:04:39 +01:00
David Michael Barr
bfb8bcc1df odb-pack: resurrect pack_backend__read_header 2012-12-03 10:39:17 +11:00
David Michael Barr
44f9f54797 pack: add git_packfile_resolve_header
To paraphrase @peff:

You can get both size and type from a packed object reasonably cheaply.
If you have:

* An object that is not a delta; both type and size are available in the
  packfile header.
* An object that is a delta. The packfile type will be OBJ_*_DELTA, and
  you have to resolve back to the base to find the real type. That means
  potentially a lot of packfile index lookups, but each one is
  relatively cheap. For the size, you inflate the first few bytes of the
  delta, whose header will tell you the resulting size of applying the
  delta to the base.

For simplicity, we just decompress the whole delta for now.
2012-12-03 10:39:17 +11:00
nulltoken
cc1466264a revparse: Deploy EINVALIDSPEC usage 2012-12-01 08:34:31 +01:00
nulltoken
bc05f30c47 object: refine git_object_peel() error report 2012-12-01 08:34:29 +01:00
nulltoken
18d6f12040 tag: Deploy EINVALIDSPEC usage 2012-12-01 08:34:28 +01:00
nulltoken
80212ecb1c reflog: Deploy EINVALIDSPEC usage 2012-12-01 08:34:27 +01:00
nulltoken
80d9d1df14 refs: Deploy EINVALIDSPEC usage 2012-12-01 08:34:26 +01:00
nulltoken
83458bb77f refs: Fix error clearing 2012-12-01 08:34:24 +01:00
nulltoken
032ba9e4ad remote: deploy EINVALIDSPEC usage 2012-12-01 08:34:23 +01:00
Ben Straub
0ab3a2ab2c Deploy GIT_INIT_STRUCTURE 2012-11-30 20:34:50 -08:00
David Michael Barr
d1b6ea8ad1 delta-apply: add git__delta_read_header 2012-12-01 14:50:45 +11:00
Ben Straub
c7231c45fe Deploy GITERR_CHECK_VERSION 2012-11-30 16:31:42 -08:00