Commit Graph

10103 Commits

Author SHA1 Message Date
Adam Niedzielski
c11c08a552 Skip uninteresting commits in revwalk timesort iterator
Fixes #4099
2017-03-09 14:01:10 +01:00
Edward Thomson
11c8e756ac git_futils_readbuffer: don't compute sha-1
Don't compute the sha-1 in `git_futils_readbuffer_updated` unless the
checksum was requested.  This means that `git_futils_readbuffer` will
not calculate the checksum unnecessarily.
2017-03-09 12:26:23 +00:00
Edward Thomson
b31b236004 Merge pull request #4154 from libgit2/ethomson/namespaces
Support namespaced references again
2017-03-06 15:53:57 +00:00
Edward Thomson
835805625a refdb_fs: honor the namespace 2017-03-06 14:20:12 +00:00
Edward Thomson
d24ae06d72 refs::namespace: add namespace tests
These simple tests only ensure that we enforce the existence of a
namespace; these mirror the rugged tests, they are not exhaustive.
2017-03-06 14:11:00 +00:00
Richard Ipsum
5c06111be6 README: Mention how to run tests 2017-03-05 15:36:19 +00:00
David Turner
2270ca9f8f rebase: ignore untracked files in submodules
An untracked file in a submodule should not prevent a rebase from
starting.  Even if the submodule's SHA is changed, and that file would
conflict with a new tracked file, it's still OK to start the rebase
and discover the conflict later.

Signed-off-by: David Turner <dturner@twosigma.com>
2017-03-03 15:07:54 -05:00
Carlos Martín Nieto
467185ff13 Merge pull request #4150 from libgit2/ethomson/freshen_trees
git_commit_create: freshen tree objects in commit
2017-03-03 16:12:12 +01:00
Edward Thomson
52d03f37f7 git_commit_create: freshen tree objects in commit
Freshen the tree object that a commit points to during commit time.
2017-03-03 14:12:00 +00:00
Carlos Martín Nieto
3348570a0c Merge pull request #4136 from libgit2/ethomson/sha1dc
Introduce (optional) SHA1 collision attack detection
2017-03-03 12:36:36 +01:00
Edward Thomson
9f128d2a77 cmake: drop unset SHA1_TYPE
We never set `SHA1_TYPE` to `builtin`.  Don't bother testing for it.
2017-03-03 10:50:28 +00:00
Edward Thomson
d087c8f80e hash: test for sha1 collision attack detection 2017-03-03 10:50:28 +00:00
Edward Thomson
2dfd1294f7 hash: include sha1collisiondetection
Include the SHA1 collision attack detection library from
https://github.com/cr-marcstevens/sha1collisiondetection
2017-03-03 10:50:27 +00:00
Edward Thomson
a371a8ae94 hash: rename implementation selection constants 2017-03-03 10:50:27 +00:00
Edward Thomson
1c04a96b25 Honor core.fsyncObjectFiles 2017-03-02 09:11:33 +00:00
Patrick Steinhardt
ba2bc4911d Merge pull request #4148 from pks-t/pks/fix-haiku-builds
cmake: only enable supported compiler warning flags
2017-03-01 14:51:39 +01:00
Patrick Steinhardt
a02e8a3882 cmake: only enable supported compiler warning flags
We currently unconditionally enable the "-Wall" and "-Wextra" flags.
Some platforms rely on compilers which do not support these flags,
though. One of these platforms is Haiku, which does not support
"-Wextra" due to being stuck on GCC version 2.

Fix builds on such platforms by adding these flags only if supported by
the compiler.
2017-03-01 13:58:15 +01:00
Patrick Steinhardt
a454641ee8 Merge pull request #4145 from pks-t/pks/refs-create-memleak
tests: refs::create: fix memory leak
2017-03-01 08:45:48 +01:00
Patrick Steinhardt
b65a5e9ba9 winhttp: disambiguate error messages when sending requests 2017-03-01 07:58:40 +01:00
Patrick Steinhardt
5aa1f12a81 tests: refs::create: fix memory leak 2017-03-01 07:45:14 +01:00
Patrick Steinhardt
cf8e9a3ad5 Merge pull request #4143 from richardipsum/issue-4094
Fix: make reflog include "(merge)" for merge commits
2017-03-01 07:35:44 +01:00
Richard Ipsum
397cf1a1f5 Add test for inclusion of (merge) in reflog
This test ensures that the string '(merge)' is included in the reflog
when a merge commit is made.
2017-02-28 22:32:21 +00:00
Edward Thomson
3ac05d1149 win32: don't fsync parent directories on Windows
Windows doesn't support it.
2017-02-28 13:29:01 +00:00
Edward Thomson
2a5ad7d0f2 fsync: call it "synchronous" object writing
Rename `GIT_OPT_ENABLE_SYNCHRONIZED_OBJECT_CREATION` ->
`GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION`.
2017-02-28 13:29:01 +00:00
Edward Thomson
1229e1c4d7 fsync parent directories when fsyncing
When fsync'ing files, fsync the parent directory in the case where we
rename a file into place, or create a new file, to ensure that the
directory entry is flushed correctly.
2017-02-28 13:28:36 +00:00
Edward Thomson
5a747e0c6c git_futils_writebuffer: default only when flags==0
Only use defaults for `git_futils_writebuffer` when flags == 0, lest
(1 << 31) be treated as the defaults.
2017-02-28 13:28:36 +00:00
Edward Thomson
eb56ed81af refdb_fs: optionally fsync packed refs 2017-02-28 13:28:36 +00:00
Edward Thomson
af3dcb0e50 refdb_fs: optionally fsync loose references 2017-02-28 13:28:36 +00:00
Edward Thomson
5312621bd4 git_futils_writebuffer: optionally fsync
Add a custom `O_FSYNC` bit (if it's not been defined by the operating
system`) so that `git_futils_writebuffer` can optionally do an `fsync`
when it's done writing.

We call `fsync` ourselves, even on systems that define `O_FSYNC` because
its definition is no guarantee of its actual support.  Mac, for
instance, defines it but doesn't support it in an `open(2)` call.
2017-02-28 13:27:50 +00:00
Edward Thomson
1c2c0ae2a4 packbuilder: honor git_object__synchronized_writing
Honor `git_object__synchronized_writing` when creating a packfile and
corresponding index.
2017-02-28 13:27:50 +00:00
Edward Thomson
e6ed0d2f03 odb_loose: fsync tests
Introduce a simple counter that `p_fsync` implements.  This is useful
for ensuring that `p_fsync` is called when we expect it to be, for
example when we have enabled an odb backend to perform `fsync`s when
writing objects.
2017-02-28 13:27:49 +00:00
Edward Thomson
6d3ad7e09e Add ENABLE_SYNCHRONIZED_OBJECT_CREATION option
Allow users to enable `SYNCHRONIZED_OBJECT_CREATION` with a setting.
2017-02-28 13:27:49 +00:00
Edward Thomson
fc27fe213c odb_loose: actually honor the fsync option
We've had an fsync option for a long time, but it was "ignored".
Stop ignoring it.
2017-02-28 13:27:49 +00:00
Edward Thomson
fc77891f63 git_filebuf: optionally fsync when committing 2017-02-28 13:27:49 +00:00
Richard Ipsum
1255a9ac0c Fix: make reflog include "(merge)" for merge commits
This fixes issue #4094
2017-02-27 23:53:12 +00:00
Edward Thomson
a4b5ac643c Merge pull request #4138 from richardipsum/symbolic-create-arbitrary-tgt-test
tests: Add create__symbolic_with_arbitrary_content
2017-02-26 16:12:30 +00:00
Edward Thomson
55d911d69a Merge pull request #4142 from pblesi/patch-1
Fix minor typos in CONVENTIONS.md
2017-02-26 16:08:00 +00:00
Edward Thomson
6313a20855 Merge pull request #4141 from kainjow/patch-2
Fix inet_pton tests triggering an assert in Haiku
2017-02-26 16:01:32 +00:00
Patrick Blesi
c1239e3327 Fix minor typos in CONVENTIONS.md 2017-02-25 23:09:42 -06:00
Kevin Wojniak
4017017740 Fix inet_pton tests triggering an assert in Haiku
Haiku will assert in a nightly build if the "dst" input to inet_pton() is NULL.
2017-02-25 10:21:59 -08:00
Richard Ipsum
b84e58f45d Whitespace and style fixes
Use C style comments as per style guide,
and fix mismatching indentation.
2017-02-25 14:18:16 +00:00
Richard Ipsum
d2b3a21f2b tests: Add create__symbolic_with_arbitrary_content
This test ensures that it's possible to create a symbolic ref that
has arbitrary data as its target. It also ensures it's possible
to obtain the target of that symbolic reference from the git_reference
object.
2017-02-25 14:18:16 +00:00
Edward Thomson
7143145f2f Merge pull request #4137 from libgit2/ethomson/appveyor
appveyor: don't rewrite the system mingw
2017-02-25 12:45:14 +00:00
Edward Thomson
408a7b7737 appveyor: don't rewrite system mingw
Download mingw-w64 into our build directory and execute it there, don't
try to overwrite the system's mingw.
2017-02-24 20:25:45 +00:00
Edward Thomson
c3abb1d261 appveyor: always build the 'appveyor' branch
The 'appveyor' branch is useful for testing AppVeyor builds.
2017-02-24 17:39:01 +00:00
Patrick Steinhardt
7f875fb4f6 Merge pull request #4133 from stinb/khash-cleanup-regression
fix regression from #4092
2017-02-24 08:51:50 +01:00
Jason Haslam
685f22519c pack: fix looping over cache entries
Fixes a regression from #4092. This is a crash on 32-bit and I assume that
it doesn't do the right thing on 64-bit either. MSVC emits a warning for this,
but of course, it's easy to get lost among all of the similar 'possible loss
of data' warnings.
2017-02-22 09:29:00 -07:00
Carlos Martín Nieto
c03f00ea9c Merge pull request #4131 from pks-t/pks/attrcache-cleanups
Attrcache cleanups
2017-02-22 16:30:57 +01:00
Carlos Martín Nieto
86201b92c3 Merge pull request #4135 from libgit2/ethomson/ancient_gcc_not_threadsafe
Provide error on gcc < 4.1 when THREADSAFE
2017-02-22 16:17:54 +01:00
Edward Thomson
aa5ea47f73 Provide error on gcc < 4.1 when THREADSAFE
Provide a descriptive error message when compiling THREADSAFE on gcc
versions < 4.1.  We require the atomic primitives (eg
`__sync_synchronize`) that were introduced in that version.

(Note, clang setes `__GNUC__` but appears to set its version > 4.1.)
2017-02-22 11:21:56 +00:00