Commit Graph

10132 Commits

Author SHA1 Message Date
Patrick Steinhardt
e5a620de80 tests: add submodule worktree test data
Create worktrees for submodule repositories. The worktrees are
created for the parent repository (e.g. the one containing
submodules) and for the contained child repository.
2017-02-13 10:13:02 +01:00
Patrick Steinhardt
bd9f4fd24c tests: add worktree test data 2017-02-13 10:13:02 +01:00
Edward Thomson
b0c3fa36c1 Merge pull request #4112 from cbargren/fix/proxy-env-vars
Add support for lowercase proxy environment variables
2017-02-10 16:15:41 +00:00
Christopher Bargren
61189a115b Fixing a code style issue 2017-02-10 07:59:22 -07:00
Edward Thomson
683ff4f323 Merge pull request #4111 from pks-t/pks/dos-prefix
dirname with DOS prefixes
2017-02-10 11:01:23 +00:00
Edward Thomson
2b8163b8b3 Merge pull request #4117 from rcjsuen/patch-1
Flag options in git_stash_apply and git_stash_pop as being optional
2017-02-10 10:59:27 +00:00
Gaurav Saral
61acc9fade Changes to provide option to turn off/on ofs_delta
This change provides an option in git_libgit2_opt_t which can be used in git_libgit2_opts to turn off/on ofs_delta capability in libGit2
2017-02-10 15:22:00 +05:30
Edward Thomson
45d55797b6 Merge pull request #4119 from libgit2/ethomson/submodule_renames
rename detection: don't try to detect submodule renames
2017-02-10 08:57:37 +00:00
Edward Thomson
191474a1f4 diff: don't do rename detection on submodules 2017-02-09 22:35:09 +00:00
Edward Thomson
95367366b2 merge: don't do rename detection on submodules 2017-02-09 18:28:39 +00:00
Edward Thomson
49806e9bc4 merge_trees: introduce test for submodule renames
Test that shows that submodules are incorrectly considered in renames,
and `git_merge_trees` will fail to lookup the submodule as a blob.
2017-02-09 18:13:06 +00:00
Remy Suen
93e2c74493 Flag optional parameters for apply and pop
The options parameter in both git_stash_apply and git_stash_pop can
be NULL. They should be flagged as such in the documentation.
2017-02-09 19:12:31 +09:00
Edward Thomson
b4bd5e8453 Merge pull request #4104 from cbargren/fix/windows-digest-proxy
Fix digest credentials for proxy in windows
2017-02-09 09:27:04 +00:00
Christopher Bargren
2af282d835 Addressing PR feedback 2017-02-08 15:01:30 -07:00
Christopher Bargren
5f3276c7e6 Add support for lowercase proxy environment variables
curl supports HTTPS_PROXY in addition to https_proxy (and their http counterparts). This change ensures parity with curl's behavior.
2017-02-08 15:01:24 -07:00
Patrick Steinhardt
3428a52359 tests: repo: assert discovery starting at Win32 roots finishes
As of recently, we failed to correctly discover repositories at a
Win32 system root. Instead of aborting the upwards-traversal of
the file system, we were looping infinitely when traversal
started at either a Win32 drive prefix ("C:/") or a network path
("//somehost").

The issue has been fixed, so add a test to catch regressions.
2017-02-08 12:06:05 +01:00
Patrick Steinhardt
9e8d75c7d4 path: ensure dirname on Win32 prefix always has a trailing '/'
When calling `git_path_dirname_r` on a Win32 prefix, e.g. a drive
or network share prefix, we always want to return the trailing
'/'. This does not work currently when passing in a path like
'C:', where the '/' would not be appended correctly.

Fix this by appending a '/' if we try to normalize a Win32 prefix
and there is no trailing '/'.
2017-02-08 12:05:47 +01:00
Patrick Steinhardt
5d59520ccd path: get correct dirname for Windows root
Getting the dirname of a filesystem root should return the filesystem
root itself. E.g. the dirname of "/" is always "/". On Windows, we
emulate this behavior and as such, we should return e.g. "C:/" if
calling dirname on "C:/". But we currently fail to do so and instead
return ".", as we do not check if we actually have a Windows prefix
before stripping off the last directory component.

Fix this by calling out to `win32_prefix_length` immediately after
stripping trailing slashes, returning early if we have a prefix.
2017-02-08 12:03:49 +01:00
Patrick Steinhardt
d8c06070a8 path: extract win32_path_prefix function
Extract code which determines if a path is at a Windows system's root.
This incluses drive prefixes (e.g. "C:\") as well as network computer
names (e.g. "//computername/").
2017-02-08 12:03:45 +01:00
Edward Thomson
be249bca1b Merge pull request #4109 from rcjsuen/patch-1
Flag checkout_opts in git_reset as optional
2017-02-08 10:21:55 +00:00
Christopher Bargren
1e929eb5e2 Pass proxy options payload to credentials callback 2017-02-06 11:00:06 -07:00
Chris Bargren
fa2dfcf924 Fix digest credentials for proxy in windows 2017-02-06 10:56:00 -07:00
Remy Suen
3a13365269 Flag checkout_opts in git_reset as optional
The check_outs argument can be NULL and should be flagged accordingly
in the header file.
2017-02-05 07:12:32 +09:00
Edward Thomson
887c1931a2 Merge pull request #4108 from rcjsuen/patch-1
Flag given_opts in git_revert as optional
2017-02-04 11:04:30 +01:00
Remy Suen
21d4a3783e Flag given_opts in git_revert as optional
The given_opts argument can actually be NULL and thus should be
flagged accordingly in the header file.
2017-02-04 17:24:31 +09:00
Edward Thomson
104a1b0bd9 Merge pull request #4105 from pks-t/pks/vector-reverse-overflow
Vector reverse overflow
2017-02-02 17:21:23 +01:00
Patrick Steinhardt
f47db3c799 vector: do not reverse a vector if it is empty
The code reversing a vector initially determines the rear-pointer by
simply subtracting 1 from the vector's length. Obviously, this fails if
the vector is empty, in which case we have an integer overflow.

Fix the issue by returning early if the vector is empty.
2017-02-02 16:02:57 +01:00
Adam Niedzielski
390431c322 revwal: add failing test for walking with topo-sort 2017-02-02 16:01:37 +01:00
Edward Thomson
9ba610a11a Merge pull request #4096 from mplough/master
Update docs for git_oid_fromstrn and p
2017-02-02 13:31:33 +00:00
Matthew Plough
921493cc94 Update docs for git_oid_fromstrn and p 2017-01-27 14:37:16 -05:00
Edward Thomson
dad3c319d7 Merge pull request #4095 from mplough/master
Fix uninitialized variable warning
2017-01-27 17:56:52 +00:00
Matthew Plough
d0c418c0bb Fix uninitialized variable warning
Fix the following warning emitted by clang:
[ 16%] Building C object CMakeFiles/libgit2_clar.dir/src/submodule.c.o
/Users/mplough/devel/external/libgit2/src/submodule.c:408:6: warning: variable 'i' is used uninitialized whenever 'if' condition is true
      [-Wsometimes-uninitialized]
        if ((error = load_submodule_names(names, cfg)))
            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/mplough/devel/external/libgit2/src/submodule.c:448:20: note: uninitialized use occurs here
        git_iterator_free(i);
                          ^
/Users/mplough/devel/external/libgit2/src/submodule.c:408:2: note: remove the 'if' if its condition is always false
        if ((error = load_submodule_names(names, cfg)))
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/mplough/devel/external/libgit2/src/submodule.c:404:17: note: initialize the variable 'i' to silence this warning
        git_iterator *i;
                       ^
                        = NULL
1 warning generated.
2017-01-27 12:49:48 -05:00
Carlos Martín Nieto
8df1cfc9d7 Merge pull request #4086 from libgit2/ethomson/fixes
WIP: some coverity & compiler warning fixes
2017-01-24 21:26:41 +00:00
Carlos Martín Nieto
9b51cc82ff Merge pull request #4050 from ethomson/ethomson/winhttp_errmsgs
WinHTTP: set proper error messages when SSL fails
2017-01-24 21:10:46 +00:00
Edward Thomson
1f813cf2b8 checkout::tree test: cleanup memory leak 2017-01-23 17:32:13 -06:00
Edward Thomson
7f66a70eec attr_cache_remove: don't remove given file
If `attr_cache_lookup_entry` fails to find the given file, make sure
that we do not try to free the given file.
2017-01-23 23:23:54 +00:00
Edward Thomson
a0d3847983 mac: on 32 bit, use __builtin_umull_overflow 2017-01-23 22:29:58 +00:00
Edward Thomson
60c2bf47e4 submodule: only examine idx & head given a config 2017-01-23 22:29:57 +00:00
Edward Thomson
0fbff82b57 submodule: don't double free during load failure
When we fail to load submodules, don't free the list; it is later freed
unconditionally.
2017-01-23 22:24:40 +00:00
Edward Thomson
1196807380 Merge pull request #4087 from tiennou/warnings
Fix a few recent warnings
2017-01-23 13:29:14 +00:00
Etienne Samson
e2b3dc16b9 variable 'i' is used uninitialized whenever 'if' condition is true 2017-01-23 13:32:34 +01:00
Etienne Samson
7414acf5f9 parameter 'id' not found in the function declaration 2017-01-23 13:32:34 +01:00
Edward Thomson
185fe9c1c1 Merge pull request #4051 from tiennou/clang-analyzer-1
Clang analyzer run
2017-01-21 23:58:41 +00:00
Edward Thomson
048c5ea7c0 Merge pull request #4053 from chescock/extend-packfile-by-pages
Extend packfile in increments of page_size.
2017-01-21 23:55:21 +00:00
Edward Thomson
8d3b39a6ad Merge branch 'pr/3912' 2017-01-21 23:50:38 +00:00
Edward Thomson
28d0ba0ba5 symbolic ref target validation: fixups
Fixups requested in #3912.
2017-01-21 23:45:23 +00:00
Edward Thomson
1910a04adb winhttp: set proper cert failure error messages
Set up a WinHTTP status callback; inspect the WinHTTP status for
WINHTTP_CALLBACK_STATUS_SECURE_FAILURE, and convert the status code
to a useful message for callers.
2017-01-21 23:15:54 +00:00
Edward Thomson
0418d3b7a8 Merge pull request #4078 from pks-t/pks/example-cleanup
Fix general example memory leaks
2017-01-21 23:11:13 +00:00
Edward Thomson
44e8af8f29 Merge pull request #3892 from mitesch/shared_buffer
Use a shared buffer in calls of git_treebuilder_write to avoid heap contention
2017-01-21 22:51:50 +00:00
Edward Thomson
3b4eb107c2 CHANGELOG: move git_submodule_update_option changes
The changes to `git_submodule_update_option` are now landing in v.Next.
2017-01-21 22:40:37 +00:00