Commit Graph

2112 Commits

Author SHA1 Message Date
schu
3fa1ec4af6 tests-clar/repo: fix unused warning
ifdef GIT_WIN32 helper unposix_path() to avoid unused-function warning
on non-Windows systems.

Signed-off-by: schu <schu-github@schulog.org>
2012-04-15 20:30:12 +02:00
Carlos Martín Nieto
146f5c75d7 repo: plug a couple of leaks 2012-04-14 15:09:29 +02:00
Vicent Martí
e77e53edb3 Merge pull request #627 from arrbee/diff-with-pathspec
Diff with pathspec
2012-04-13 20:06:49 -07:00
Russell Belfer
14a513e058 Add support for pathspec to diff and status
This adds preliminary support for pathspecs to diff and status.
The implementation is not very optimized (it still looks at
every single file and evaluated the the pathspec match against
them), but it works.
2012-04-13 15:00:29 -07:00
Vicent Martí
d1f331564d Merge remote-tracking branch 'carlosmn/revwalk-merge-base' into new-error-handling 2012-04-13 20:41:06 +02:00
Vicent Martí
fcb2164ff1 Merge pull request #623 from arrbee/refactor-open
Update git_repository_open
2012-04-13 10:51:58 -07:00
Carlos Martín Nieto
6a62543597 branch: simplify error handling for git_branch_move()
The cleanup needs to happen anyway, so set the error code and jump
there instead of copying the code.
2012-04-12 23:40:41 +02:00
Vicent Martí
bf63cd0bd2 Merge pull request #625 from carlosmn/valgrind
Plug a few leaks
2012-04-12 14:28:15 -07:00
Carlos Martín Nieto
a15156930b local transport: plug leak 2012-04-12 20:54:55 +02:00
Carlos Martín Nieto
6a8bcfa48e branch: plug leaks in git_branch_move() and _delete() 2012-04-12 20:47:46 +02:00
Carlos Martín Nieto
eb8117b841 error-handling: revwalk 2012-04-12 20:27:17 +02:00
Carlos Martín Nieto
bf787bd87c Move git_merge_base() to is own header and document it 2012-04-12 20:25:25 +02:00
Carlos Martín Nieto
f9e4bfa39b revwalk: use a priority queue for calculating merge bases
As parents are older than their children, we're appending to the
commit list most of the time, which makes an ordered linked list quite
inefficient.

While we're there, don't sort the results list in the main loop, as
we're sorting them afterwards and it creates extra work.
2012-04-12 20:25:25 +02:00
Carlos Martín Nieto
5cf7bccd2b revwalk: add test hiding a commit without a merge base
Nothing should be hidden and this shouldn't bother the merge base
calculation.
2012-04-12 20:25:25 +02:00
Carlos Martín Nieto
2c4ef1dd0d revwalk: use merge bases to speed up processing
There is no need walk down the parents of a merge base to mark them as
uninteresting because we'll never see them. Calculate the merge bases
in prepare_walk() so mark_uninteresting() can stop at a merge base
instead of walking all the way to the root.
2012-04-12 20:25:25 +02:00
Carlos Martín Nieto
de7ab85dc6 Implement git_merge_base()
It's implemented in revwalk.c so it has access to the revision
walker's commit cache and related functions. The algorithm is the one
used by git, modified so it fits better with the library's functions.
2012-04-12 20:25:24 +02:00
Carlos Martín Nieto
06b9d91590 revwalk: allow pushing/hiding a reference by name
The code was already there, so factor it out and let users push an OID
by giving it a reference name. Only refs to commits are
supported. Annotated tags will throw an error.
2012-04-12 20:25:24 +02:00
Carlos Martín Nieto
081d229106 revwalk: don't assume malloc succeeds 2012-04-12 20:25:24 +02:00
Russell Belfer
7784bcbbee Refactor git_repository_open with new options
Add a new command `git_repository_open_ext` with extended options
that control how searching for a repository will be done.  The
existing `git_repository_open` and `git_repository_discover` are
reimplemented on top of it.  We may want to change the default
behavior of `git_repository_open` but this commit does not do that.

Improve support for "gitdir" files where the work dir is separate
from the repo and support for the "separate-git-dir" config.  Also,
add support for opening repos created with `git-new-workdir` script
(although I have only confirmed that they can be opened, not that
all functions work correctly).

There are also a few minor changes that came up:

- Fix `git_path_prettify` to allow in-place prettifying.

- Fix `git_path_root` to support backslashes on Win32.  This fix
  should help many repo open/discover scenarios - it is the one
  function called when opening before prettifying the path.

- Tweak `git_config_get_string` to set the "out" pointer to NULL
  if the config value is not found.  Allows some other cleanup.

- Fix a couple places that should have been calling
  `git_repository_config__weakptr` and were not.

- Fix `cl_git_sandbox_init` clar helper to support bare repos.
2012-04-11 12:11:35 -07:00
Russell Belfer
1de77cd314 Cannot set workdir to a nonexistent dir 2012-04-11 12:10:14 -07:00
Vicent Martí
64b402f856 status: Remove status_old
This is Git yo. You can fetch stuff from the history if you need it.
2012-04-11 19:19:12 +02:00
Vicent Martí
e1f6f94a92 tests: Remove unused file 2012-04-11 19:17:21 +02:00
Carlos Martín Nieto
a62053a050 error-handling local transport 2012-04-11 19:16:10 +02:00
Carlos Martín Nieto
5eb8affb38 error-handling: fetch 2012-04-11 19:16:10 +02:00
Carlos Martín Nieto
fc1cc2051e Use new error handling in the example network code 2012-04-11 19:16:10 +02:00
Carlos Martín Nieto
bd6585a7f5 netops: show winsock error messages on Windows 2012-04-11 19:16:10 +02:00
Carlos Martín Nieto
56b7df108c error-handling: netops 2012-04-11 19:16:10 +02:00
Carlos Martín Nieto
25530fca3b error-handling: http 2012-04-11 19:16:10 +02:00
Carlos Martín Nieto
2b386acdb3 error-handling: git transport 2012-04-11 19:16:10 +02:00
Carlos Martín Nieto
84d250bfeb error-handling: protocol, pkt 2012-04-11 19:16:10 +02:00
Carlos Martín Nieto
4376f7f6f4 error-handling: remote, transport 2012-04-11 19:16:10 +02:00
nulltoken
d4d648b042 Fix compilation errors and warnings 2012-04-11 15:30:56 +02:00
Carlos Martín Nieto
1a2b87257d Typedefs don't have enum in front 2012-04-11 14:27:40 +02:00
Vicent Martí
0a20eee953 Merge pull request #619 from nulltoken/topic/branches
Basic branch management API
2012-04-11 03:43:30 -07:00
nulltoken
b78fb64d2f repository: make git_repository_set_workdir() prettify the path it is being passed 2012-04-11 12:40:21 +02:00
Vicent Martí
dcfdb958e2 Merge branch 'new-error-handling' of github.com:libgit2/libgit2 into new-error-handling 2012-04-11 12:38:45 +02:00
nulltoken
4615f0f71b branch: add git_branch_move() 2012-04-10 21:39:06 +02:00
nulltoken
555aa453ba fileops: Make git_futils_mkdir_r() able to skip non-empty directories 2012-04-10 21:39:05 +02:00
nulltoken
731df57080 Add basic branch management API: git_branch_create(), git_branch_delete(), git_branch_list() 2012-04-10 21:39:03 +02:00
nulltoken
79fd42301e transport/local: Fix peeling of nested tags 2012-04-10 21:39:01 +02:00
nulltoken
3f46f313cb tag: Add git_tag_peel() which recursively peel a tag until a non tag git_object is met 2012-04-10 21:38:49 +02:00
Vicent Martí
efef3795a2 Merge pull request #618 from nulltoken/fix/warning
Fix compilation warning
2012-04-04 10:37:25 -07:00
nulltoken
17bd6de3fb Fix MSVC "unreferenced local variable" compilation warning. 2012-04-04 13:59:58 +02:00
Carlos Martín Nieto
8e8b6b01f5 Clean up valgrind warnings 2012-04-04 13:13:43 +02:00
Vicent Martí
2ec83ff09d Merge pull request #596 from nulltoken/fix/non-7bit-ascii-reference-names
Allow references to bear non-7bit-ascii names on Windows
2012-04-02 17:25:05 -07:00
Vicent Martí
73fe6a8e20 error-handling: Commit (WIP) 2012-04-02 20:41:48 +02:00
nulltoken
09719c500c reference: Fix creation of references with extended ASCII characters in their name 2012-04-01 14:33:32 +02:00
Vicent Martí
9273399bdb Merge pull request #610 from arrbee/status-rewrite
Rewrite status using diff
2012-03-31 08:23:37 -07:00
Russell Belfer
952f94c8ab Fix bug when join_n refers to original buffer
There was a bug in git_buf_join_n when the contents of the
original buffer were joined into itself and the realloc
moved the pointer to the original buffer.
2012-03-30 14:42:23 -07:00
Russell Belfer
95dfb031f7 Improve config handling for diff,submodules,attrs
This adds support for a bunch of core.* settings that affect
diff and status, plus fixes up some incorrect implementations
of those settings from before.  Also, this cleans up the
handling of config settings in the new submodules code and
in the old attrs/ignore code.
2012-03-30 14:40:50 -07:00