Commit Graph

8967 Commits

Author SHA1 Message Date
Carlos Martín Nieto
b0885675f7 Merge pull request #3425 from ethomson/diriter_root
Handle `git_path_diriter` instances at the drive root on Windows
2015-09-13 23:21:14 +02:00
Carlos Martín Nieto
ceb01c091b Merge pull request #3426 from ethomson/fs_iterator
iterator: loop fs_iterator advance (don't recurse)
2015-09-13 22:31:08 +02:00
Edward Thomson
9d905541bf diriter: don't double '/' on posix
The canonical directory path of the root directory of a volume on
POSIX already ends in a slash (eg, `/`).  This is true only at the
root.  Do not add a slash to paths in this case.
2015-09-13 14:18:08 -04:00
Edward Thomson
26d7cf6e57 iterator: loop fs_iterator advance (don't recurse) 2015-09-13 14:07:54 -04:00
Edward Thomson
5a466befaf diriter: don't double '/' on Windows
The canonical directory path of the root directory of a volume on
windows already ends in a slash (eg, `c:/`).  This is true only
at the volume root.  Do not add a slash to paths in this case.
2015-09-13 13:59:41 -04:00
Edward Thomson
2cde210d47 diriter: test we can iterate root
Ensure that we can iterate the filesystem root and that paths come
back well-formed, not with an additional '/'.  (eg, when iterating
`c:/`, expect that we do not get some path like `c://autoexec.bat`).
2015-09-13 13:52:23 -04:00
Carlos Martín Nieto
f2b25261cf Merge pull request #3423 from libgit2/cmn/push-tests-inline-oid
push: put the git_oid inline in the test structure
2015-09-13 19:43:55 +02:00
Carlos Martín Nieto
e78aeefa18 Merge pull request #3420 from ethomson/iterator
iterator: advance the tree iterator smartly
2015-09-13 19:43:39 +02:00
Carlos Martín Nieto
9562ebcd6b Merge pull request #3424 from arthurschreiber/arthur/transaction-dont-free-config
Don't free config in `git_transaction_commit`.
2015-09-13 17:33:26 +02:00
Arthur Schreiber
548cb33434 Don't free config in git_transaction_commit.
The config is not owned by the transaction, so please don’t free it.
2015-09-13 16:32:24 +02:00
Carlos Martín Nieto
1e80bf27ea Merge branch 'cmn/ignore-dir-check' 2015-09-13 06:21:18 +02:00
Carlos Martín Nieto
657afd359e ignore: add test and adjust style and comment for dir with wildmatch
The previous commit left the comment referencing the earlier state of
the code, change it to explain the current logic. While here, change the
logic to avoid repeating the copy of the base pattern.
2015-09-13 06:18:49 +02:00
Carlos Martín Nieto
305407e1bb Merge pull request #3370 from libgit2/cmn/submodule-refactor
submodule: refactor to be more explicit in the search
2015-09-13 06:03:12 +02:00
Carlos Martín Nieto
1af5aecb96 push: put the git_oid inline in the test structure
These are small pieces of data, so there is no advantage to allocating
them separately. Include the two ids inline in the struct we use to
check that the expected and actual ids match.
2015-09-13 05:38:29 +02:00
Carlos Martín Nieto
dc5b678fda Merge pull request #3422 from ethomson/workdir_diff
diff: examine pathlist on non-files
2015-09-12 22:49:23 +02:00
Edward Thomson
8ab4d0e1e1 diff: check pathspec on non-files
When we're not doing pathspec matching, we let the iterator handle
file matching for us.  However, we can only trust the iterator to
return *files* that match the pattern, because the iterator must
return directories that are not strictly in the pathlist, but that
are the parents of files that match the pattern, so that diff can
later recurse into them.

Thus, diff must examine non-files explicitly before including them
in the delta list.
2015-09-12 15:32:18 -04:00
Edward Thomson
92f7d32b59 diff::workdir: ensure ignored files are not returned
Ensure that a diff with the workdir is not erroneously returning
directories.
2015-09-12 13:46:22 -04:00
Carlos Martín Nieto
049dbf42f5 Merge pull request #3421 from ethomson/mempack-fix
Mempack fix
2015-09-12 04:00:34 +02:00
Edward Thomson
220d6f8a10 mempack: expose clear function 2015-09-11 20:06:14 -04:00
Bryan Woods
707f65372b Removing memory leak in mempack's free
It calls git_mempack_reset which reallocates the object array. git_oidmap_free is now called on it explicitly.
2015-09-11 16:35:14 -07:00
Edward Thomson
a1859e21f3 iterator: advance the tree iterator smartly
While advancing the tree iterator, if we advance over things that
we aren't interested in, then call `current`.  Which may *itself*
call advance.

While advancing the tree iterator, if we advance over things that
we aren't interested in, then call `current`.  Which may *itself*
call advance.

While advancing the tree iterator, if we advance over things that
we aren't interested in, then call `current`.  Which may *itself*
call advance.

While advancing the tree iterator, if we advance over things that
we aren't interested in, then call `current`.  Which may *itself*
call advance.

While advancing the tree iterator, if we advance over things that
we aren't interested in, then call `current`.  Which may *itself*
call advance.

Error: stack overflow.
2015-09-11 17:38:28 -04:00
Bryan Woods
8e177b2bb8 Fixing dangling pointers in git_mempack_reset
git_mempack_reset was leaving free'd pointers in the oidmap.
2015-09-10 14:44:52 -07:00
Carlos Martín Nieto
a3b9731ff8 submodule: add a test for a renamed submdoule dir 2015-09-10 21:23:03 +02:00
Carlos Martín Nieto
f17525b0ff submodule: refactor to be more explicit in the search
When searching for information about a submdoule, let's be more explicit
in what we expect to find. We currently insert a submodule into the map
and change certain parameters when the config callback gets called.

Switch to asking for the configuration we're interested in, rather than
taking it in an arbitrary order.
2015-09-10 20:36:02 +02:00
Matt Burke
d29c5412aa Avoid segfault when opts == NULL 2015-09-10 14:16:39 -04:00
Matt Burke
3245896bb7 Add a test for custom header validation
Also, *some* custom headers actually are valid.
2015-09-10 13:18:26 -04:00
Matt Burke
66d90e7098 More specific names 2015-09-10 09:14:20 -04:00
Matt Burke
8c876fa91d Validate custom http headers 2015-09-10 09:11:16 -04:00
Matt Burke
35969c6839 Ignore NULL headers 2015-09-10 08:58:23 -04:00
Matt Burke
c49126c87f Accept custom headers for fetch too 2015-09-10 08:34:35 -04:00
Carlos Martín Nieto
6c21211c38 Merge pull request #3379 from theseion/additional_libssh2_error_reporting
report libssh2 error if list of authentication methods can't be retrieved
2015-09-09 13:59:38 +02:00
Carlos Martín Nieto
53ba8c9e8b Merge pull request #3415 from ethomson/lock_hidden
filebuf: ensure we can lock a hidden file
2015-09-09 01:37:06 +02:00
Edward Thomson
8e736a73ca futils: ensure we can write a hidden file 2015-09-08 15:56:50 -04:00
Edward Thomson
ea3f2c296a filebuf: ensure we can lock a hidden file 2015-09-08 15:56:35 -04:00
Matt Burke
c82c2ba60f o i 2015-09-08 14:17:59 -04:00
Matt Burke
5d7cd57f99 Update another call to git_remote_connect 2015-09-08 14:15:29 -04:00
Matt Burke
80ee25434d Teach winhttp about the extra headers 2015-09-08 14:04:59 -04:00
Matt Burke
276f6aa08d Hook up the custom_headers to the http transport 2015-09-08 14:02:47 -04:00
Matt Burke
4f2b6093a6 Tell the git_transport about the custom_headers 2015-09-08 14:02:33 -04:00
Matt Burke
9da32a6255 Add custom_headers to git_push_options 2015-09-08 14:02:25 -04:00
Matt Burke
24f5b4e155 Drop extra_http_headers from git_remote 2015-09-08 14:01:57 -04:00
Edward Thomson
c1770aeb8b Merge pull request #3410 from libgit2/cmn/ssh-embed-again
Revert "Get rid of libssh2 embedding"
2015-09-08 12:43:36 -04:00
Carlos Martín Nieto
6d6020defc Merge pull request #3353 from ethomson/wrongcase_add
index: canonicalize directory case when adding
2015-09-08 18:34:51 +02:00
Edward Thomson
2964cbeae1 Merge pull request #3381 from leoyanggit/index_directory_iterator
New feature: add the ablility to iterate through a directory in index
2015-09-08 11:50:08 -04:00
Edward Thomson
a32bc85e84 git_index_add: allow case changing renames
On case insensitive platforms, allow `git_index_add` to provide a new
path for an existing index entry.  Previously, we would maintain the
case in an index entry without the ability to change it (except by
removing an entry and re-adding it.)

Higher-level functions (like `git_index_add_bypath` and
`git_index_add_frombuffers`) continue to keep the old path for easier
usage.
2015-09-08 11:34:00 -04:00
Edward Thomson
280adb3f94 index: canonicalize directory case when adding
On case insensitive systems, when given a user-provided path in the
higher-level index addition functions (eg `git_index_add_bypath` /
`git_index_add_frombuffer`), examine the index to try to match the
given path to an existing directory.

Various mechanisms can cause the on-disk representation of a folder
to not match the representation in HEAD or the index - for example,
a case changing rename of some file `a/file.txt` to `A/file.txt`
will update the paths in the index, but not rename the folder on
disk.

If a user subsequently adds `a/other.txt`, then this should be stored
in the index as `A/other.txt`.
2015-09-08 11:32:40 -04:00
Edward Thomson
e1d27bcaaf Merge pull request #3413 from libgit2/cmn/follow-symlink
filebuf: follow symlinks when creating a lock file
2015-09-06 10:51:29 -04:00
Edward Thomson
9fd4c9c867 Merge pull request #3366 from libgit2/cmn/index-hashmap
Use a hashmap for path-based lookups in the index
2015-09-06 10:50:22 -04:00
Carlos Martín Nieto
d83b2e9f51 filebuf: follow symlinks when creating a lock file
We create a lockfile to update files under GIT_DIR. Sometimes these
files are actually located elsewhere and a symlink takes their place. In
that case we should lock and update the file at its final location
rather than overwrite the symlink.
2015-09-05 16:43:49 +02:00
Leo Yang
c097f7173d New API: git_index_find_prefix
Find the first index entry matching a prefix.
2015-09-04 12:24:36 -04:00