Commit Graph

6433 Commits

Author SHA1 Message Date
Jiri Pospisil
6ad59ef1d4 examples: Use git_object_short_id 2014-04-01 12:16:40 +02:00
Edward Thomson
3ab5781601 Merge pull request #2178 from libgit2/rb/fix-short-id
Fix git_odb_short_id and git_odb_exists_prefix bugs
2014-03-31 23:23:32 -07:00
Vicent Marti
fad0412027 Merge pull request #2224 from ethomson/merge_file_const
Const up members of git_merge_file_result
2014-03-31 20:15:35 +02:00
Edward Thomson
7f930ded88 Const up members of git_merge_file_result 2014-03-31 11:08:31 -07:00
Vicent Marti
336e895721 Merge pull request #2222 from ethomson/merge_head_id
Introduce git_merge_head_id
2014-03-31 19:17:01 +02:00
Edward Thomson
976634c467 Introduce git_merge_head_id 2014-03-31 11:43:38 -05:00
Carlos Martín Nieto
088334278b Merge pull request #2219 from tiennou/reset-need-pack
Don't reset need_pack
2014-03-31 18:43:13 +02:00
Etienne Samson
31143b3655 Don't reset need_pack
While looping over multiple heads, an up-to-date head will clobber the `remote->need_pack` setting, preventing the rest of the machinery from building and downloading a pack-file, breaking fetches.
2014-03-30 19:08:56 +02:00
Edward Thomson
7b445c2195 Merge pull request #2216 from ethomson/clar
Update clar to 4b75388
2014-03-29 20:05:06 -07:00
Edward Thomson
ed38bff16c Update clar to 4b75388 2014-03-28 19:15:55 -07:00
Vicent Marti
71ba28e3a5 Merge pull request #2214 from ethomson/sandbox_config
RFC: Sandbox HOME during test execution
2014-03-28 19:03:37 +01:00
Edward Thomson
e0d61c7b1c Sandbox configuration during test runs 2014-03-28 10:39:15 -07:00
Edward Thomson
10be94e9dc Update clar to 587f88a 2014-03-28 10:39:07 -07:00
Vicent Marti
04d4d674fe Merge pull request #2212 from libgit2/rb/submodule-use-after-free
Fix use-after-free in submodule reload code and other memory leaks
2014-03-27 23:40:28 +01:00
Russell Belfer
dae8ba6e09 Fix memory leak of test repository object 2014-03-27 15:29:32 -07:00
Russell Belfer
acdc7cff2e Fix memory leak of submodule branch name 2014-03-27 15:29:17 -07:00
Russell Belfer
add8db06f9 Fix use-after-free in submodule reload
If the first call to release a no-longer-existent submodule freed
the object, the check if a second is needed would dereference the
data that was just freed.
2014-03-27 15:28:29 -07:00
Vicent Marti
041fad4aac Merge pull request #2210 from libgit2/rb/submodule-api-with-no-submodules
Fix segfault if gitmodules is invalid
2014-03-27 08:32:46 +01:00
Russell Belfer
380f864a10 Fix error when submodule path and name differ
When a submodule was inserted with a different path and name, the
return value from khash greater than zero was allowed to propagate
back out to the caller when it should really be zeroed.  This led
to a possible crash when reloading submodules if that was the
first time that submodule data was loaded.
2014-03-26 16:06:21 -07:00
Russell Belfer
22df47cbc5 Fix segfault if gitmodules is invalid
The reload_all call could end up dereferencing a NULL pointer if
there was an error while attempting to load the submodules config
data (i.e. invalid content in the gitmodules file).  This fixes it.
2014-03-26 14:38:26 -07:00
Vicent Marti
f4afcaa0d5 Merge pull request #2209 from ethomson/cleanup
Cleanup some warnings and mem leaks
2014-03-26 19:37:01 +01:00
Edward Thomson
9cb99e8b85 Free temporary merge index 2014-03-26 12:43:41 -05:00
Edward Thomson
2b848e47c1 Decorate unused params as unused in revwalk::hidecb tests 2014-03-26 12:33:37 -05:00
Vicent Marti
dc7efa1aef Merge pull request #2204 from libgit2/rb/submodule-reference-counting
Make submodules externally refcounted
2014-03-26 18:29:34 +01:00
Vicent Marti
77b699e0da Merge pull request #2205 from libgit2/rb/submodule-untracked-vs-ignored
Update behavior for untracked contained repositories
2014-03-26 10:29:11 +01:00
Vicent Marti
fcbbe1bd82 Merge pull request #2166 from ethomson/giterr_restore
clone: don't overwrite original error message
2014-03-26 10:27:42 +01:00
Edward Thomson
1df8ad01d7 clone: don't overwrite original error message 2014-03-25 21:54:42 -07:00
Edward Thomson
f2f2d97f1e Test for giterr_capture 2014-03-25 21:54:41 -07:00
Russell Belfer
591e82952a Fix submodule leaks and invalid references
This cleans up some places I missed that could hold onto submodule
references and cleans up the way in which the repository cache is
both reloaded and released so that existing submodule references
aren't destroyed inappropriately.
2014-03-25 16:52:01 -07:00
Russell Belfer
d3bc95fd66 Update behavior for untracked sub-repos
When a directory containing a .git directory (or even just a plain
gitlink) was found, libgit2 was going out of its way to treat it
specially.  This seemed like it was necessary because the diff
code was not originally emulating Git's behavior for untracked
directories correctly (i.e. scanning for ignored vs untracked items
inside).  Now that libgit2 diff mimics Git's untracked directory
behavior, the special handling for contained Git repos is actually
incorrect and this commit rips it out.
2014-03-25 12:37:05 -07:00
Edward Thomson
451aaf866a Merge pull request #2181 from anuraggup/hide_cb
Callback function to hide commit and its parents in revision walker
2014-03-25 10:33:18 -07:00
Russell Belfer
a15c7802c8 Make submodules externally refcounted
`git_submodule` objects were already refcounted internally in case
the submodule name was different from the path at which it was
stored.  This makes that refcounting externally used as well, so
`git_submodule_lookup` and `git_submodule_add_setup` return an
object that requires a `git_submodule_free` when done.
2014-03-25 09:14:48 -07:00
Anurag Gupta
34ffe22344 Modified test for revwalk_hidecb 2014-03-24 11:21:01 -07:00
Anurag Gupta
892b7c9fef Correcting format of comments in header file 2014-03-24 11:20:51 -07:00
Anurag Gupta
169fb81d87 Undoing local change done for building on x64 2014-03-24 11:20:41 -07:00
Anurag Gupta
7ca1584b47 Conforming to libgit2 coding style. 2014-03-24 11:20:31 -07:00
Anurag Gupta
46e4d82d6f Remove unused push_cb_data 2014-03-24 11:20:22 -07:00
Anurag Gupta
3a666071d9 Unit Tests for hide_cb in revwalk 2014-03-24 11:20:13 -07:00
Anurag Gupta
892aa808e2 Callback to hide commits in revision walker. 2014-03-24 11:20:03 -07:00
Russell Belfer
f210cb5b14 Merge pull request #2201 from ethomson/gitbuf_test_fix
env test needs to deref git_buf's ptr
2014-03-24 10:58:10 -07:00
Edward Thomson
fdc54eb2fb env test needs to deref git_buf's ptr 2014-03-24 10:56:11 -07:00
Vicent Marti
85a41fc4bf Merge pull request #2183 from ethomson/merge_refactor
Refactor the `git_merge` API
2014-03-24 18:09:13 +01:00
Vicent Marti
f57cc63811 Merge pull request #2200 from libgit2/cmn/opts-buf
settings: use git_buf for returning strings
2014-03-24 13:52:02 +01:00
Carlos Martín Nieto
6057c4a038 opts: bits are not bytes
The default cache size is 256 megabytes, not megabits as claimed in the
docs.
2014-03-24 13:21:51 +01:00
Carlos Martín Nieto
42dee8ecd7 settings: use git_buf for returning strings
This survived the last round of culling, as the signature is only in the
comments.
2014-03-24 13:21:51 +01:00
Vicent Marti
0deb534d76 Merge pull request #2197 from linquize/assert-wrong
Fix wrong assertion
2014-03-21 12:25:53 +01:00
Linquize
31a14982a0 Fix wrong assertion
Fixes issue #2196
2014-03-21 17:36:34 +08:00
Vicent Marti
36a80fdaed Merge pull request #2195 from libgit2/cmn/revwalk-no-hide
revwalk: don't try to find merge bases when there can be none
2014-03-20 21:06:23 +01:00
Carlos Martín Nieto
704b55cce3 revwalk: don't try to find merge bases when there can be none
As a way to speed up the cases where we need to hide some commits, we
find out what the merge bases are so we know to stop marking commits as
uninteresting and avoid walking down a potentially very large amount of
commits which we will never see. There are however two oversights in
current code.

The merge-base finding algorithm fails to recognize that if it is only
given one commit, there can be no merge base. It instead walks down the
whole ancestor chain needlessly. Make it return an empty list
immediately in this situation.

The revwalk does not know whether the user has asked to hide any commits
at all. In situation where the user pushes multiple commits but doesn't
hide any, the above fix wouldn't do the trick. Keep track of whether the
user wants to hide any commits and only run the merge-base finding
algorithm when it's needed.
2014-03-20 20:24:11 +01:00
Vicent Marti
7d63357266 Merge pull request #2194 from libgit2/cmn/reflog-bare
reflog: follow core.logallrefupdates
2014-03-20 20:08:01 +01:00