Commit Graph

1291 Commits

Author SHA1 Message Date
Edward Thomson
1ac5acdc69 Merge pull request #2819 from libgit2/cmn/config-get-path
config: add parsing and getter for paths
2015-01-26 11:28:59 -06:00
Edward Thomson
7c48508b28 structinit test: only run on DEBUG builds
The structinit tests don't make sense unless structure padding
is uniformly initialized, which is unlikely to happen on release
builds.  Only enable them for DEBUG builds.  Further, rename them
to core::structinit.
2015-01-21 12:55:17 -06:00
Edward Thomson
0ad5c845d2 structinit test: show which byte differs 2015-01-21 11:53:20 -06:00
Edward Thomson
e0902fbce7 checkout tests: cleanup realpath impl on Win32 2015-01-20 17:13:52 -06:00
Edward Thomson
53eb139dcb checkout tests: emulate p_realpath poorly on Win32 2015-01-20 17:13:41 -06:00
Edward Thomson
e74340b000 checkout: remove files before writing new ones
On case insensitive filesystems, we may have files in the working
directory that case fold to a name we want to write.  Remove those
files (by default) so that we will not end up with a filename that
has the unexpected case.
2015-01-20 17:13:31 -06:00
Edward Thomson
232bc89598 checkout tests: nasty symlinks
Symbolic links that abuse case insensitivity to write into .git.
2015-01-20 17:13:09 -06:00
Edward Thomson
1fbfcdfcd0 git_path_join_unrooted: return base len
The documentation for `git_path_join_unrooted` states that the base
length will be returned, so that consumers like checkout know where
to start creating directories instead of always creating directories
at the directory root.
2015-01-20 17:12:35 -06:00
Edward Thomson
1d50b3649d checkout: introduce git_checkout_perfdata
Checkout can now provide performance data about the number of (some)
syscalls performed using an optional callback.
2015-01-20 17:12:23 -06:00
Linquize
b4c6a9da93 Add files and tests with many UTF-8 chars and few UTF-8 chars 2015-01-20 16:17:48 -06:00
Sven Strickroth
0161e096a3 Make binary detection work similar to vanilla git
Main change: Don't treat chars > 128 as non-printable (common in UTF-8 files)

Signed-off-by: Sven Strickroth <email@cs-ware.de>
2015-01-20 16:17:37 -06:00
Carlos Martín Nieto
eac773d92b config: add parsing and getter for paths 2015-01-14 19:36:50 +01:00
Edward Thomson
85880693d5 Merge branch 'pr/2740' 2015-01-14 10:19:28 -06:00
Pierre-Olivier Latour
36fc549781 Added GIT_HASHSIG_ALLOW_SMALL_FILES to allow computing signatures for small files
The implementation of the hashsig API disallows computing a signature on
small files containing only a few lines. This new flag disables this
behavior.

git_diff_find_similar() sets this flag by default which means that rename
/ copy detection of small files will now work. This in turn affects the
behavior of the git_status and git_blame APIs which will now detect rename
of small files assuming the right options are passed.
2015-01-14 10:17:56 -06:00
Carlos Martín Nieto
d4b2410126 Merge commit '4b1018d24f980273528743c27c47ceb96cb720bd'
Fix crash in free() when git_buf_grow() fails.
2015-01-09 16:47:48 +01:00
Jeff Hostetler
4b1018d24f Fix crash in free() when git_buf_grow() fails. 2015-01-09 16:46:44 +01:00
Carlos Martín Nieto
fe8399fe9b Fix warning 2015-01-09 16:29:08 +01:00
Carlos Martín Nieto
788c5f1ca8 Merge pull request #2810 from ethomson/remove_symlinks
Remove symlinks from the repository
2015-01-09 10:23:08 +01:00
Edward Thomson
365d367238 submodule::init tests: free some leaks 2015-01-08 22:31:15 +00:00
Edward Thomson
3b40ed897f repo::init test: create hook symlink
Remove the hook symlink from the test resources, so that we can
have a source tree that is easy to zip up and copy around on systems
that don't support symlinks.  Create it dynamically at test execution
instead.
2015-01-08 19:23:37 +00:00
Edward Thomson
1646412d8f Merge pull request #2802 from calavera/remote_create_prune_config
Load prune configuration when a remote is created.
2015-01-08 11:20:44 -06:00
David Calavera
de4a75f977 Fix more indentation. 2015-01-07 09:26:36 -08:00
David Calavera
c868981f0e Add extern function to initialize submodule update options. 2015-01-07 09:04:49 -06:00
David Calavera
66b71ea5f5 Fix intentation. 2015-01-05 13:33:36 -08:00
David Calavera
1ef3f0cebb Load prune configuration when a remote is created. 2015-01-05 13:24:11 -08:00
Carlos Martín Nieto
0c6012293a Merge commit 'refs/pull/2632/head' of github.com:libgit2/libgit2 2015-01-05 20:10:43 +00:00
Carlos Martín Nieto
c4a2fd5c1d Plug a couple of leaks 2015-01-04 17:39:43 +00:00
Edward Thomson
a3ef70bb40 Merge pull request #2761 from libgit2/cmn/fetch-prune
Remote-tracking branch prunning
2014-12-30 11:53:55 -06:00
Edward Thomson
c4c47fc286 Merge pull request #2762 from libgit2/cmn/hide-push
remote: remove git_push from the public API
2014-12-30 11:53:45 -06:00
Carlos Martín Nieto
fe794b2ea7 remote: remove git_push from the public API
Instead we provide git_remote_upload() and git_remote_update_tips() in
order to have a parallel API for fetching and pushing.
2014-12-30 17:02:50 +00:00
Carlos Martín Nieto
208a2c8aef treebuilder: rename _create() to _new()
This function is a constructor, so let's name it like one and leave
_create() for the reference functions, which do create/write the
reference.
2014-12-27 12:09:11 +00:00
Edward Thomson
40d791545a Always checkout with case sensitive iterator
On a case-insensitive filesystem, we need to deal with case-changing
renames (eg, foo -> FOO) by removing the old and adding the new,
exactly as if we were on a case-sensitive filesystem.

Update the `checkout::tree::can_cancel_checkout_from_notify` test, now
that notifications are always sent case sensitively.
2014-12-23 10:14:04 -06:00
Edward Thomson
61ee5b0e57 Introduce test for checkout case-changing rename 2014-12-23 10:14:01 -06:00
Jameson Miller
9d1f97df10 Introduce a convenience function for submodule update
This introduces the functionality of submodule update in
'git_submodule_do_update'. The existing 'git_submodule_update' function is
renamed to 'git_submodule_update_strategy'. The 'git_submodule_update'
function now refers to functionality similar to `git submodule update`,
while `git_submodule_update_strategy` is used to get the configured value
of submodule.<name>.update.
2014-12-22 16:37:35 -05:00
Jameson Miller
b2ab887e11 submodule init should resolve relative url paths
Submodule init should handle relative paths in .gitmodules files
and resolve these urls when updating the git config file.
2014-12-22 16:35:45 -05:00
Edward Thomson
c7d9839f54 Merge pull request #2763 from libgit2/cmn/local-proto-progress
Show progress output on fetch for the local transport
2014-12-20 21:22:30 -06:00
Linquize
6987a580f7 Add more Windows reserved filenames 2014-12-19 23:54:42 +08:00
Linquize
6fd00266a8 COM0 is a valid path, although Windows Explorer does not allow to create this 2014-12-19 23:54:01 +08:00
Edward Thomson
2842831800 index tests: test capitalization before mkdir 2014-12-18 12:41:59 -06:00
Carlos Martín Nieto
c90ed5b558 Plug leaks 2014-12-18 02:11:06 +01:00
Carlos Martín Nieto
c679bf42f5 Create miscapitialised dirs for case-sensitive filesystems
We need these directories to exist so cl_git_mkfile() can create the
files we ask it to.
2014-12-18 02:07:36 +01:00
Edward Thomson
dce7b1a4e7 treebuilder: take a repository for path validation
Path validation may be influenced by `core.protectHFS` and
`core.protectNTFS` configuration settings, thus treebuilders
can take a repository to influence their configuration.
2014-12-17 13:05:27 -05:00
Edward Thomson
ec74b40cee Introduce core.protectHFS and core.protectNTFS
Validate HFS ignored char ".git" paths when `core.protectHFS` is
specified.  Validate NTFS invalid ".git" paths when `core.protectNTFS`
is specified.
2014-12-17 12:52:07 -05:00
Edward Thomson
11d67b754d checkout: disallow bad paths on HFS
HFS filesystems ignore some characters like U+200C.  When these
characters are included in a path, they will be ignored for the
purposes of comparison with other paths.  Thus, if you have a ".git"
folder, a folder of ".git<U+200C>" will also match.  Protect our
".git" folder by ensuring that ".git<U+200C>" and friends do not match it.
2014-12-16 10:08:59 -06:00
Edward Thomson
ee5da720e5 reference_create: validate loose names
Validate loose reference names on Win32.
2014-12-16 10:08:56 -06:00
Edward Thomson
a64119e396 checkout: disallow bad paths on win32
Disallow:
 1. paths with trailing dot
 2. paths with trailing space
 3. paths with trailing colon
 4. paths that are 8.3 short names of .git folders ("GIT~1")
 5. paths that are reserved path names (COM1, LPT1, etc).
 6. paths with reserved DOS characters (colons, asterisks, etc)

These paths would (without \\?\ syntax) be elided to other paths - for
example, ".git." would be written as ".git".  As a result, writing these
paths literally (using \\?\ syntax) makes them hard to operate with from
the shell, Windows Explorer or other tools.  Disallow these.
2014-12-16 10:08:53 -06:00
Vicent Marti
0d388adc86 index: Check for valid paths before creating an index entry 2014-12-16 10:08:49 -06:00
Edward Thomson
cceae9a25d win32: use NT-prefixed "\\?\" paths
When turning UTF-8 paths into UCS-2 paths for Windows, always use
the \\?\-prefixed paths.  Because this bypasses the system's
path canonicalization, handle the canonicalization functions ourselves.

We must:
 1. always use a backslash as a directory separator
 2. only use a single backslash between directories
 3. not rely on the system to translate "." and ".." in paths
 4. remove trailing backslashes, except at the drive root (C:\)
2014-12-16 10:08:43 -06:00
Carlos Martín Nieto
3ded7f28c7 local: add failing test for sideband information
We do not currently generate any messages when we're counting the
objects, as might be expected from a local upload-pack. Assert that we
do call the function when working.
2014-12-16 10:05:49 +01:00
Carlos Martín Nieto
4adc64a81a fetch: plug leaks in the prune tests 2014-12-14 21:52:27 +01:00
Carlos Martín Nieto
26186b155b fetch: remove the prune setter
This option does not get persisted to disk, which makes it different
from the rest of the setters. Remove it until we go all the way.

We still respect the configuration option, and it's still possible to
perform a one-time prune by calling the function.
2014-12-14 21:52:27 +01:00
Carlos Martín Nieto
7b6e1e4cc6 fetch: add test for the other order of overlapping specs 2014-12-14 21:25:08 +01:00
Carlos Martín Nieto
4aa2336966 fetch: assert we don't call update tips when there are no upates
This is hiding a bug in the prune code, whereby we prune references we
shouldn't but don't notice it in the code afterwards because
update_tips() recreates them.

This means that we do perform changes to the references (and get rid of
the reflogs) when we shouldn't.
2014-12-14 17:04:02 +01:00
Carlos Martín Nieto
020aab9308 fetch: do set prune when testing
We load the remote again, so we need to ask the new remote to prune the
refs, or we're not exercising the code in our tests.
2014-12-14 17:04:02 +01:00
David Calavera
5e0c3d2d1a Make sure that fetch --prune --tags doesn't remove tags. 2014-12-14 17:04:02 +01:00
David Calavera
b91194e842 Cleanup repository after prune tests. 2014-12-14 17:04:02 +01:00
David Calavera
93d968fa07 Cleanup after testing remote prune. 2014-12-14 17:04:02 +01:00
David Calavera
82eeba8142 Fix references to git_remote_lookup. 2014-12-14 17:04:01 +01:00
David Calavera
439e19f632 Test that prune overlapping works as expected. 2014-12-14 17:04:01 +01:00
David Calavera
ce4b57c6bc Fix calls to git_remote_download and git_remote_fetch. 2014-12-14 17:04:01 +01:00
Linquize
b8fefcb9ca Add test for prune refs 2014-12-14 17:04:01 +01:00
Edward Thomson
09debe1213 clar: wide character comparisons 2014-12-10 18:11:50 -05:00
Edward Thomson
3410084675 tests: use p_ instead of posix func directly 2014-12-10 18:11:50 -05:00
Carlos Martín Nieto
d524b2d3d1 push: fold unpack_ok() into finish()
The push cannot be successful if we sent a bad packfile. We should
return an error in that case instead of storing it elsewhere.
2014-12-10 18:55:54 +01:00
Edward Thomson
6b11eb51ee core::link test: clean up junction point name 2014-12-09 12:04:53 -05:00
Edward Thomson
80b01c8f26 win32: remember to free wide env name/value 2014-12-09 12:04:50 -05:00
Edward Thomson
d5087689b5 Merge pull request #2750 from linquize/generate.py
Update clar to e3985dd
2014-12-08 23:03:30 -05:00
Linquize
8e0aa2ebce Fix broken merge tests due to autocrlf was not false 2014-12-07 23:41:30 +08:00
Linquize
d226fbf1aa Fix broken test suite on Windows 2014-12-07 22:42:06 +08:00
Linquize
3a1eb9e5ff Update clar to e3985dd 2014-12-07 22:09:00 +08:00
Edward Thomson
19ae843937 Merge pull request #2746 from libgit2/cmn/neg-ignore-dir
Fix negative ignores withing ignored dirs
2014-12-06 20:17:16 -05:00
Edward Thomson
013924c17c Merge pull request #2730 from libgit2/cmn/local-push
Adjust the local transport for the common refspec parser
2014-12-05 23:44:34 -05:00
Carlos Martín Nieto
21083a7129 notes: move the notes name argument
Make it consistent between git_note_create() and git_note_remote() by
putting it after the repository.
2014-12-06 04:20:09 +01:00
Carlos Martín Nieto
e0a97416d4 ignore: adjust test for negating inside a dir
Given

    top
    !top/foo

in an ignore file, we should not unignore top/foo. This is an
implementation detail of the git code leaking, but that's the behaviour
we should show.

A negation rule can only negate an exact rule it has seen before.
2014-12-05 19:43:36 +01:00
nulltoken
30ec05260d Merge pull request #2744 from epmatsw/spelling
Spelling fixes
2014-12-05 07:44:09 +01:00
Will Stamper
b874629b2d Spelling fixes 2014-12-04 21:06:59 -06:00
Edward Thomson
6d91dc5351 init: return the number of initializations 2014-12-04 20:42:27 -05:00
Jeff Hostetler
93aef71e90 fix cl_git_mkfile() to test for -1 rather than 0 for errors from p_creat() 2014-11-26 14:12:11 -05:00
Edward Thomson
e952bc5a57 Merge pull request #2718 from libgit2/cmn/peeling-errors
peel: reject bad queries with EPEEL
2014-11-23 17:15:18 -05:00
Carlos Martín Nieto
3fade40e39 remote: add test for pushing and deleting with the local transport 2014-11-23 21:29:35 +01:00
Carlos Martín Nieto
f7fcb18f8a Plug leaks
Valgrind is now clean except for libssl and libgcrypt.
2014-11-23 15:51:31 +01:00
Carlos Martín Nieto
753e17b0f5 peel: reject bad queries with EINVALIDSPEC
There are some combination of objects and target types which we know
cannot be fulfilled. Return EINVALIDSPEC for those to signify that there
is a mismatch in the user-provided data and what the object model is
capable of satisfying.

If we start at a tag and in the course of peeling find out that we
cannot reach a particular type, we return EPEEL.
2014-11-22 18:55:22 +01:00
Vicent Marti
92e0b67930 buffer: Do not put anything if len is 0 2014-11-21 17:21:33 +01:00
Vicent Marti
e015665142 odb: git_odb_object contents are never NULL
This is a contract that we made in the library and that we need to uphold. The
contents of a blob can never be NULL because several parts of the library (including
the filter and attributes code) expect `git_blob_rawcontent` to always return a
valid pointer.
2014-11-21 14:09:53 +01:00
Carlos Martín Nieto
1ca61bdcb9 fetch: clear the connection data on close
When we fetch twice with the same remote object, we did not properly
clear the connection flags, so we would leak state from the last
connection.

This can cause the second fetch with the same remote object to fail if
using a HTTP URL where the server redirects to HTTPS, as the second
fetch would see `use_ssl` set and think the initial connection wanted to
downgrade the connection.
2014-11-19 20:57:15 +01:00
Edward Thomson
93b982b1c8 Merge pull request #2654 from linquize/missing-obj
Fix missing object in tests/resources/crlf by changing the tail commit
2014-11-18 12:12:19 -05:00
Edward Thomson
45301cca30 Merge pull request #2608 from libgit2/cmn/remote-push
Provide a convenience function `git_remote_push()`
2014-11-18 11:44:59 -05:00
Edward Thomson
8b5b814e55 Merge pull request #2671 from swisspol/remote_create_fix
Fixed active_refspecs field not initialized on new git_remote objects
2014-11-17 20:10:58 -05:00
Edward Thomson
7f1b73b7c8 Merge pull request #2693 from libgit2/cmn/push-refspec-refactor
push: use the common refspec parser
2014-11-17 17:03:55 -05:00
Edward Thomson
a4221ccb09 Merge pull request #2699 from swisspol/fix_warnings
Fixed a couple Clang warnings
2014-11-17 16:36:54 -05:00
Pierre-Olivier Latour
d3cd7da51f Fixed active_refspecs field not initialized on new git_remote objects
When creating a new remote, contrary to loading one from disk,
active_refspecs was not populated. This means that if using the new
remote to push, git_push_update_tips() will be a no-op since it
checks the refspecs passed during the push against the base ones
i.e. active_refspecs. And therefore the local refs won't be created
or updated after the push operation.
2014-11-17 22:46:22 +09:00
Carlos Martín Nieto
5915d7001b branch: consider an empty upstream remote config as not found 2014-11-17 14:28:22 +01:00
Pierre-Olivier Latour
692c040843 Fixed a couple Clang warnings 2014-11-10 08:18:48 +09:00
Carlos Martín Nieto
aad638f3a1 push: use the common refspec parser
There is one well-known and well-tested parser which we should use,
instead of implementing parsing a second time.

The common parser is also augmented to copy the LHS into the RHS if the
latter is empty.

The expressions test had to change a bit, as we now catch a bad RHS of a
refspec locally.
2014-11-09 16:07:43 +01:00
Carlos Martín Nieto
64e3e6d43a remote: use configured push refspecs if none are given
If the user does not pass any refspecs to push, try to use those
configured via the configuration or via add_push().
2014-11-09 00:01:58 +01:00
Carlos Martín Nieto
6eb9e39ce0 push: move main test function to git_remote_push()
We have the step-by-step method in the initialization function as we
want to remove references based on the list of references which are
already there, and we can use the convenience function for testing the
main push.
2014-11-09 00:01:58 +01:00
Carlos Martín Nieto
3149547b5a remote: introduce git_remote_push()
This function, similar in style to git_remote_fetch(), performs all the
steps required for a push, with a similar interface.

The remote callbacks struct has learnt about the push callbacks, letting
us set the callbacks a single time instead of setting some in the remote
and some in the push operation.
2014-11-09 00:01:58 +01:00
Carlos Martín Nieto
799e22ea0c Rename git_threads_ to git_libgit2_
This describes their purpose better, as we now initialize ssl and some
other global stuff in there. Calling the init function is not something
which has been optional for a while now.
2014-11-08 23:46:39 +01:00
Pierre-Olivier Latour
e284c451b0 Changed GIT_REMOTE_DOWNLOAD_TAGS_ALL to behave like git 1.9.0 2014-11-09 07:27:30 +09:00
Edward Thomson
02bc523304 Merge pull request #2698 from libgit2/cmn/fetchhead-refactor
Refactor fetchhead
2014-11-08 17:05:13 -05:00
Edward Thomson
bc8c4a8aeb Merge pull request #2695 from libgit2/cmn/remote-lookup
remote: rename _load() to _lookup()
2014-11-08 16:55:23 -05:00
Edward Thomson
e3bd48a793 Merge pull request #2696 from libgit2/cmn/empty-objects
odb: hardcode the empty blob and tree
2014-11-08 16:52:43 -05:00
Carlos Martín Nieto
e1ac010148 odb: hardcode the empty blob and tree
git hardocodes these as objects which exist regardless of whether they
are in the odb and uses them in the shell interface as a way of
expressing the lack of a blob or tree for one side of e.g. a diff.

In the library we use each language's natural way of declaring a lack of
value which makes a workaround like this unnecessary. Since git uses it,
it does however mean each shell application would need to perform this
check themselves.

This makes it common work across a range of applications and an issue
with compatibility with git, which fits right into what the library aims
to provide.

Thus we introduce the hard-coded empty blob and tree in the odb
frontend. These hard-coded objects are checked for before going to the
backends, but after the cache check, which means the second time they're
used, they will be treated as normal cached objects instead of creating
new ones.
2014-11-08 20:53:38 +01:00
Carlos Martín Nieto
64fdd86d0e remote: don't check for upstream on an anonymous remote
If the remote is anonymous, then we cannot check for any configuration,
as there is no name. Check for this before we try to use the name, which
may be a NULL pointer.

This fixes #2697.
2014-11-08 20:21:14 +01:00
Carlos Martín Nieto
82374d9825 branch: add getter for the upstream remote name
This gets the value from branch.<foo>.remote.
2014-11-08 20:00:17 +01:00
Carlos Martín Nieto
209425ce26 remote: rename _load() to _lookup()
This brings it in line with the rest of the lookup functions.
2014-11-08 13:28:27 +01:00
Ungureanu Marius
6818208569 git_status_file now takes an exact path
This function has one output but can match multiple files, which can be
unexpected for the user, which would usually path the exact path of the
file he wants the status of.
2014-11-07 21:34:54 +02:00
Carlos Martín Nieto
62a617dc68 iterator: submodules are determined by an index or tree
We cannot know from looking at .gitmodules whether a directory is a
submodule or not. We need the index or tree we are comparing against to
tell us. Otherwise we have to assume the entry in .gitmodules is stale
or otherwise invalid.

Thus we pass the index of the repository into the workdir iterator, even
if we do not want to compare against it. This follows what git does,
which even for `git diff <tree>`, it will consider staged submodules as
such.
2014-11-07 08:33:27 +01:00
Carlos Martín Nieto
f1a7906fdf submodules: add failing test for stale module entries
We consider an entry in .gitmodules to mean that we have a submodule at
a particular path, even if HEAD^{tree} and the index do not contain any
reference to it.

We should ignore that submodule entry and simply consider that path to
be a regular directory.
2014-11-07 08:33:27 +01:00
Edward Thomson
2d24816b46 checkout_index: Remove stage 0 when checking out conflicts 2014-11-06 18:50:10 -05:00
Edward Thomson
9f664347ff checkout_index: remove conflicts when checking out new files 2014-11-06 18:49:57 -05:00
Edward Thomson
64dc248577 Merge pull request #2598 from libgit2/cmn/stacked-ignore
ignore: don't leak rules into higher directores
2014-11-06 10:38:25 -05:00
Edward Thomson
f890a84fe0 Merge pull request #2682 from libgit2/cmn/fetch-tags-refspec
remote: check for the validity of the refspec when updating FETCH_HEAD
2014-11-06 10:19:22 -05:00
Carlos Martín Nieto
0798b01400 ignore: add failing test for a file mentioning the parent
When we mention "src" in src/.gitignore, we wrongly consider src/ itself
to be ignored.
2014-11-06 10:10:26 +01:00
Edward Thomson
b4e5432ff0 Merge pull request #2688 from libgit2/cmn/ignore-file-trailing-cr
ignore: consider files with a CR in their names
2014-11-05 10:47:19 -05:00
Carlos Martín Nieto
5c54e2162a ignore: consider files with a CR in their names
We currently consider CR to start the end of the line, but that means
that we miss cases with CR CR LF which can be used with git to match
files whose names have CR at the end of their names.

The fix from the patch comes from Russell's comment in the issue.

This fixes #2536.
2014-11-05 16:22:01 +01:00
Edward Thomson
cce27d8242 git_remote_rename: propogate GIT_ENOTFOUND 2014-11-03 14:10:31 -05:00
Edward Thomson
de0c4555da Merge pull request #2679 from jfultz/missing-include
Make config reading continue after hitting a missing include file.
2014-11-03 11:32:47 -05:00
John Fultz
ebc13b2b7c Clean up issues include.path issues found during code review.
* Error-handling is cleaned up to only let a file-not-found error
  through, not other sorts of errors.  And when a file-not-found
  error happens, we clean up the error.
* Test now checks that file-not-found introduces no error.  And
  other minor cleanups.
2014-11-02 19:16:49 -06:00
Carlos Martín Nieto
ea8dedc953 remote: fix tagopt test
An anonymous remote wouldn't create remote-tracking branches, so testing
we don't create them for TAGS_ALL is nonsensical. Furthermore, the name
of the supposed remote-tracking branch was also not one which would have
been created had it had a name.

Give the remote a name and test that we only create the tags when we
pass TAGS_ALL and that we do create the remote-branch branch when given
TAGS_AUTO.
2014-11-02 20:39:29 +01:00
Carlos Martín Nieto
0f838d27f1 remote: add a failing test for checking the current branch's upstream
When we update FETCH_HEAD we check whether the remote is the current
branch's upstream remote. The code does not check whether the current
refspec is relevant for this reference but always tries to perform the
reverse transformation, which causes it to error out if the refspec
doesn't match the reference.

Thanks to Pierre-Olivier Latour for the reproduction recipe.
2014-11-02 20:03:23 +01:00
John Fultz
727ae380a5 Make config reading continue after hitting a missing include file.
For example, if you have

[include]
path = foo

and foo didn't exist, git_config_open_ondisk() would just give up
on the rest of the file.  Now it ignores the unresolved include
without error and continues reading the rest of the file.
2014-11-01 11:21:45 -05:00
Edward Thomson
53ca45ee25 revert tests: always use core.autocrlf=false in tests 2014-10-27 17:27:25 -04:00
Edward Thomson
18b00406c6 s/git_merge_head/git_annotated_commit
Rename git_merge_head to git_annotated_commit, as it becomes used
in more operations than just merge.
2014-10-26 22:59:48 -04:00
Edward Thomson
796b03bd49 rebase: clean up some warnings and memory leaks 2014-10-26 22:59:46 -04:00
Edward Thomson
ed2c06a6a1 git_rebase: iterators for operations 2014-10-26 22:59:41 -04:00
Edward Thomson
f152f8ac0c rebase: preload all operations 2014-10-26 22:59:38 -04:00
Edward Thomson
b6b636a7fa rebase: init/open a git_rebase object 2014-10-26 22:59:36 -04:00
Edward Thomson
18b439b9be git_rebase_next: provide info about the operation 2014-10-26 22:59:34 -04:00
Edward Thomson
5ae9d296e3 git_rebase_finish: rewrite notes when finishing rebase 2014-10-26 22:59:32 -04:00
Edward Thomson
a612a25fa6 git_rebase_commit: write HEAD's reflog appropriately 2014-10-26 22:59:27 -04:00
Edward Thomson
517644cce4 Introduce git_rebase_finish to complete a rebase 2014-10-26 22:59:25 -04:00
Edward Thomson
14864fbfeb git_rebase_next: test that we return GIT_ITEROVER 2014-10-26 22:59:23 -04:00
Edward Thomson
93a7004cc2 git_rebase_commit: drop already-picked commits
Already cherry-picked commits should not be re-included.  If all changes
included in a commit exist in the upstream, then we should error with
GIT_EAPPLIED.
2014-10-26 22:59:21 -04:00
Edward Thomson
a35a9890b0 Introduce git_rebase_commit
Commit the current patch of a rebase process.
2014-10-26 22:59:19 -04:00
Edward Thomson
443d5674fe git_rebase_next: write conflicts nicely during rebase 2014-10-26 22:59:16 -04:00
Edward Thomson
950a709159 Introduce git_rebase_next
`git_rebase_next` will apply the next patch (or cherry-pick)
operation, leaving the results checked out in the index / working
directory so that consumers can resolve any conflicts, as appropriate.
2014-10-26 22:59:14 -04:00
Edward Thomson
4fe84d624b Introduce git_rebase_abort
Abort an in-progress rebase and move the working directory and
repository back to the ORIG_HEAD state.
2014-10-26 22:59:12 -04:00
Edward Thomson
867a36f3a6 Introduce git_rebase to set up a rebase session
Introduce `git_rebase` to set up a rebase session that can
then be continued.  Immediately, only merge-type rebase is
supported.
2014-10-26 22:59:08 -04:00
Edward Thomson
4b1b2bd9eb revwalk::mergebase test: free memory 2014-10-26 22:27:58 -04:00
Edward Thomson
e4985fe3a9 submodule test: free submodule 2014-10-26 22:27:54 -04:00
Edward Thomson
16288d2db3 clone::local test: isalpha -> git__isalpha 2014-10-26 22:27:50 -04:00
Edward Thomson
90aa2bf39b config test: clean up memory leak 2014-10-26 22:27:48 -04:00
Edward Thomson
cdd71711ce Clean up some memory leaks 2014-10-26 22:27:44 -04:00
Carlos Martín Nieto
fad0aea9fe tests: fix leak 2014-10-27 01:47:40 +01:00
Linquize
9223f2884c Fix test repo dir not deleted after running 2014-10-27 01:06:28 +08:00
Linquize
81f1fc7142 Fix missing object in tests/resources/crlf by changing the tail commit 2014-10-26 11:41:01 +08:00
Edward Thomson
d09458f3e9 Merge pull request #2638 from libgit2/cmn/config-refresh-remove
config: remove the refresh function and backend field
2014-10-24 16:52:39 -07:00
Edward Thomson
725cd5f29d Merge pull request #2646 from libgit2/cmn/remote-rename
remote: accept a repo and name for renaming
2014-10-24 16:44:07 -07:00
Edward Thomson
a747ea49c9 Merge pull request #2647 from ethomson/clar_tmpname
clar: use a custom temp directory name
2014-10-24 14:01:13 -07:00