Commit Graph

88 Commits

Author SHA1 Message Date
Russell Belfer
d0849f830f Simplify git_path_is_empty_dir implementation
This simplifies git_path_is_empty_dir on both Windows (getting rid
of git_buf allocation inside the function) and other platforms (by
just using git_path_direach), and adds tests for the function, and
uses the function to simplify some existing tests.
2013-10-03 10:44:13 -07:00
Russell Belfer
219d345732 Initial iconv hookup for precomposed unicode
This hooks up git_path_direach and git_path_dirload so that they
will take a flag indicating if directory entry names should be
tested and converted from decomposed unicode to precomposed form.
This code will only come into play on the Apple platform and even
then, only when certain types of filesystems are used.

This involved adding a flag to these functions which involved
changing a lot of places in the code.

This was an opportunity to do a bit of code cleanup here and there,
for example, getting rid of the git_futils_cleanupdir_r function in
favor of a simple flag to git_futils_rmdir_r to not remove the top
level entry.  That ended up adding depth tracking during rmdir_r
which led to a safety check for infinite directory recursion.  Yay.

This hasn't actually been tested on the Mac filesystems where the
issue occurs.  I still need to get test environment for that.
2013-10-03 10:44:13 -07:00
Carlos Martín Nieto
0e0cf78773 clone: put the callbacks struct directly in the clone options
There's no need for this to be a pointer to somewhere else.
2013-10-02 14:04:44 +02:00
Carlos Martín Nieto
fdc7e5e35e clone: bring back NULL as defaults
This wasremoved as part of the large culling a few commits ago.
2013-10-02 06:42:27 +02:00
Carlos Martín Nieto
c833893c64 clone: re-allow using a custom remote name
This is a small thing that by itself doesn't quite justify making the
user use clone_into.
2013-10-02 06:42:26 +02:00
Carlos Martín Nieto
6ac15eff6d clone: remove more options from basic clone
The basic clone function is there to make it easy to create a "normal"
clone. Remove a bunch of options that are about changing the remote's
configuration.
2013-10-02 06:42:26 +02:00
Carlos Martín Nieto
c8dbec4803 clone: remove the autotag option
Downloading all tags is part of what makes it a clone instead of
simply a fetch.
2013-10-02 06:41:42 +02:00
Carlos Martín Nieto
605da51a2c No such thing as an orphan branch
Unfortunately git-core uses the term "unborn branch" and "orphan
branch" interchangeably. However, "orphan" is only really there for
the checkout command, which has the `--orphan` option so it doesn't
actually create the branch.

Branches never have parents, so the distinction of a branch with no
parents is odd to begin with. Crucially, the error messages deal with
unborn branches, so let's use that.
2013-09-17 09:50:30 +02:00
Russell Belfer
114f5a6c41 Reorganize diff and add basic diff driver
This is a significant reorganization of the diff code to break it
into a set of more clearly distinct files and to document the new
organization.  Hopefully this will make the diff code easier to
understand and to extend.

This adds a new `git_diff_driver` object that looks of diff driver
information from the attributes and the config so that things like
function content in diff headers can be provided.  The full driver
spec is not implemented in the commit - this is focused on the
reorganization of the code and putting the driver hooks in place.

This also removes a few #includes from src/repository.h that were
overbroad, but as a result required extra #includes in a variety
of places since including src/repository.h no longer results in
pulling in the whole world.
2013-06-10 10:10:39 -07:00
nulltoken
1fed6b07f0 Fix trailing whitespaces 2013-05-15 22:41:30 +02:00
nulltoken
249888948f Fix some memory leaks 2013-05-10 19:22:47 +02:00
Jameson Miller
6f748f3885 Do not write tagopt configuration option on clone by default 2013-05-04 12:14:40 -04:00
Carlos Martín Nieto
1ffd0806f4 remote: add resfpec list accessors
Bring back a way of acessing the git_refspec* from a remote.

Closes #1514
2013-04-30 12:04:59 +02:00
Ben Straub
bd0a07f4bb Clone: replace fetch spec with custom value 2013-04-23 12:28:59 -07:00
Nikolai Vladimirov
dfdf709e3f get last refspec in clone test 2013-04-23 22:04:37 +03:00
Carlos Martín Nieto
4330ab26b5 remote: handle multiple refspecs
A remote can have a multitude of refspecs. Up to now our git_remote's
have supported a single one for each fetch and push out of simplicity
to get something working.

Let the remotes and internal code know about multiple remotes and get
the tests passing with them.

Instead of setting a refspec, the external users can clear all and add
refspecs. This should be enough for most uses, though we're still
missing a querying function.
2013-04-20 17:54:13 +02:00
Vicent Marti
d064c74794 Merge remote-tracking branch 'ben/unified-revparse' into development 2013-04-15 23:18:24 +02:00
Ben Straub
2ebc3c66c2 Redeploy git_revparse_single. 2013-04-15 11:57:24 -07:00
Ben Straub
1aa21fe3b8 Deprecate git_revparse_single and _rangelike 2013-04-09 05:07:04 +04:00
Carlos Martín Nieto
a258d8e357 branch: rename 'tracking' to 'upstream'
The term 'tracking' is overloaded. Help distinguish what we mean by
using 'upstream' for this part of the library.
2013-03-30 15:45:57 +01:00
Jameson Miller
926acbcf8e Clone should not delete directories it did not create 2013-03-01 14:56:09 -05:00
nulltoken
c1b5e8c42b branch: Make git_branch_remote_name() cope with orphaned heads 2013-02-22 17:04:23 +01:00
nulltoken
3ad052218c Fix MSVC compilation warnings
Fix #1308
2013-02-05 20:33:27 +01:00
Frank Li
aa928de02a Add test case for clone head detached repo
Signed-off-by: Frank Li <lznuaa@gmail.com>
Signed-off-by: nulltoken <emeric.fermas@gmail.com>
2013-02-01 22:40:23 +08:00
nulltoken
bf031581d3 branch: Introduce git_branch_tracking_name() 2013-01-16 22:56:13 +01:00
Vicent Martí
e2d2c6e57d Merge pull request #1222 from scunz/clone_branch
Switch to specified branch during clone
2013-01-12 02:14:14 -08:00
Sascha Cunz
f1d4a35e94 Tests: Add test for check out of given branch during clone 2013-01-12 00:08:48 +01:00
Sascha Cunz
b5b2812097 Test: Cleanup some cleaning code 2013-01-12 00:07:44 +01:00
nulltoken
090d5e1fda Fix MSVC compilation warnings 2013-01-11 19:30:59 +01:00
nulltoken
b97fabfad5 tests: Fix some memory leaks 2013-01-06 16:22:24 +01:00
Vicent Marti
7761ce2162 Merge branch 'development' into clar2
Conflicts:
	tests-clar/clone/nonetwork.c
	tests-clar/online/clone.c
	tests-clar/online/fetchhead.c
2013-01-03 04:24:12 +01:00
Vicent Marti
f46769e52a Fix network suite 2013-01-03 02:13:37 +01:00
Ben Straub
922dd9788c Move some clone tests to the nonetwork suite 2013-01-02 13:54:37 -08:00
Ben Straub
730df6d0f7 Include checkout options inline 2013-01-02 13:43:54 -08:00
Vicent Marti
156cfec096 Cleanup Clar to make it SIMPLER 2013-01-02 02:05:11 +01:00
nulltoken
6bd09ecc14 Fix MSSVC compilation issue 2012-12-24 16:54:26 +01: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
Sascha Cunz
96a289f5f3 clone-empty-test: Don't use one pointer for two things
... so we can clean up correctly.
2012-12-19 05:24:23 +01:00
Sascha Cunz
22d23c61ed Cleanup the test correctly 2012-12-17 17:15:58 +01:00
Ben Straub
57f5d8dca5 Remove placeholder files during tests 2012-12-14 14:15:42 -08:00
Ben Straub
1164acde96 Rebase fixup 2012-12-14 14:00:35 -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
509216a5b2 test: Fix clone tests 2012-12-14 02:49:01 +01:00
Vicent Marti
b0b9fd3245 Merge remote-tracking branch 'origin/clone-auth' into development 2012-12-14 02:41:53 +01:00
Jameson Miller
8a8820d89f Add test to clone with absolute path 2012-12-13 17:58:12 -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