]> git.proxmox.com Git - libgit2.git/log
libgit2.git
6 years agoDisable tests requiring internet access
Pirate Praveen [Sat, 19 May 2018 17:40:59 +0000 (23:10 +0530)]
Disable tests requiring internet access

6 years agoupdate symbols file
Pirate Praveen [Mon, 7 May 2018 05:21:11 +0000 (10:51 +0530)]
update symbols file

6 years agorename install and symbols file to match binary change
Pirate Praveen [Sun, 6 May 2018 12:39:17 +0000 (18:09 +0530)]
rename install and symbols file to match binary change

6 years agoadd closing bug to changelog
Pirate Praveen [Sun, 6 May 2018 12:29:49 +0000 (17:59 +0530)]
add closing bug to changelog

6 years agorefresh patch
Pirate Praveen [Sun, 6 May 2018 12:17:43 +0000 (17:47 +0530)]
refresh patch

6 years agoupdate changelog
Pirate Praveen [Sun, 6 May 2018 12:15:35 +0000 (17:45 +0530)]
update changelog

6 years agoLibrary transition libgit2-26 to libgit2-27
Pirate Praveen [Sun, 6 May 2018 12:14:30 +0000 (17:44 +0530)]
Library transition libgit2-26 to libgit2-27

6 years agoupload to experimental
Pirate Praveen [Sun, 6 May 2018 12:13:06 +0000 (17:43 +0530)]
upload to experimental

6 years agoupdate changelog
Pirate Praveen [Sun, 6 May 2018 12:10:03 +0000 (17:40 +0530)]
update changelog

6 years agoUpdate dependency, replace curl with mbedTLS
Pirate Praveen [Sun, 6 May 2018 12:07:56 +0000 (17:37 +0530)]
Update dependency, replace curl with mbedTLS

6 years agoAdd upstream patch to support mbedTLS
Pirate Praveen [Sun, 6 May 2018 12:07:29 +0000 (17:37 +0530)]
Add upstream patch to support mbedTLS

6 years agoadd link to original pull request
Pirate Praveen [Sat, 5 May 2018 16:30:21 +0000 (22:00 +0530)]
add link to original pull request

6 years agoForward-port patches
Nicolas Braud-Santoni [Wed, 2 May 2018 20:37:18 +0000 (22:37 +0200)]
Forward-port patches

6 years agodebian/gbp.conf: Do not number patches
Nicolas Braud-Santoni [Wed, 2 May 2018 21:06:47 +0000 (23:06 +0200)]
debian/gbp.conf: Do not number patches

6 years agoStart work on v0.27.0+dfsg.1-0.1
Nicolas Braud-Santoni [Wed, 2 May 2018 20:31:20 +0000 (22:31 +0200)]
Start work on v0.27.0+dfsg.1-0.1

6 years agoUpdate upstream source from tag 'upstream/0.27.0+dfsg.1'
Pirate Praveen [Thu, 26 Apr 2018 12:36:14 +0000 (18:06 +0530)]
Update upstream source from tag 'upstream/0.27.0+dfsg.1'

Update to upstream version '0.27.0+dfsg.1'
with Debian dir 5579c7c802a2869448e3da65ac7f1474246c4328

6 years agoNew upstream version 0.27.0+dfsg.1
Pirate Praveen [Thu, 26 Apr 2018 12:36:07 +0000 (18:06 +0530)]
New upstream version 0.27.0+dfsg.1

6 years agoUpdate changelog for v0.26.0+dfsg.1-1.2
Nicolas Braud-Santoni [Wed, 14 Feb 2018 15:34:21 +0000 (16:34 +0100)]
Update changelog for v0.26.0+dfsg.1-1.2

6 years agodebian/source/lintian-overrides: Rename tag
Nicolas Braud-Santoni [Wed, 14 Feb 2018 15:32:18 +0000 (16:32 +0100)]
debian/source/lintian-overrides: Rename tag

6 years agoRelocate source.lintian-overrides
Nicolas Braud-Santoni [Wed, 14 Feb 2018 15:31:18 +0000 (16:31 +0100)]
Relocate source.lintian-overrides

6 years agoRemove empty Lintian override files
Nicolas Braud-Santoni [Wed, 14 Feb 2018 15:30:52 +0000 (16:30 +0100)]
Remove empty Lintian override files

6 years agodebian/watch: Fix version numbering
Nicolas Braud-Santoni [Wed, 14 Feb 2018 15:22:45 +0000 (16:22 +0100)]
debian/watch: Fix version numbering

6 years agoPrepare upload v0.26.0+dfsg.1-1.2
Nicolas Braud-Santoni [Fri, 19 Jan 2018 22:56:01 +0000 (23:56 +0100)]
Prepare upload v0.26.0+dfsg.1-1.2

6 years agodebian/control: Use an HTTPS URLs for the homepage
Nicolas Braud-Santoni [Fri, 19 Jan 2018 22:55:32 +0000 (23:55 +0100)]
debian/control: Use an HTTPS URLs for the homepage

6 years agoSwitch to debhelper 11
Nicolas Braud-Santoni [Fri, 19 Jan 2018 22:54:58 +0000 (23:54 +0100)]
Switch to debhelper 11

6 years agodebian/control: Use canonical Vcs-* URLs
Nicolas Braud-Santoni [Sun, 14 Jan 2018 19:03:16 +0000 (20:03 +0100)]
debian/control: Use canonical Vcs-* URLs

6 years agodebian/control: Bump Standards-Version to 4.1.3
Nicolas Braud-Santoni [Sun, 14 Jan 2018 18:55:37 +0000 (19:55 +0100)]
debian/control: Bump Standards-Version to 4.1.3

Replaced `Priority: extra` with `optional`

6 years agodebian/copyright: Use HTTPS URIs
Nicolas Braud-Santoni [Sun, 14 Jan 2018 18:52:46 +0000 (19:52 +0100)]
debian/copyright: Use HTTPS URIs

6 years agodebian/copyright: Refer to the CC0 license file
Nicolas Braud-Santoni [Sun, 14 Jan 2018 18:42:02 +0000 (19:42 +0100)]
debian/copyright: Refer to the CC0 license file

Closes #882632

7 years agoRelease 0.26.0+dfsg.1-1.1 to Debian unstable.
Ximin Luo [Thu, 14 Sep 2017 09:52:25 +0000 (11:52 +0200)]
Release 0.26.0+dfsg.1-1.1 to Debian unstable.

7 years agoUse git_curl_stream_new for HTTPS because we don't link against openssl
Ximin Luo [Tue, 1 Aug 2017 14:32:00 +0000 (16:32 +0200)]
Use git_curl_stream_new for HTTPS because we don't link against openssl

7 years agoUpdate d/watch to follow naming conventions
Ximin Luo [Mon, 31 Jul 2017 13:13:09 +0000 (15:13 +0200)]
Update d/watch to follow naming conventions

+dfsg1 is more conventional, but if +dfsg.1 is desired then feel free to revert,
but also update dversionmangle=s/\+dfsg\.\d*$// as well.

7 years agoRelease 0.26.0+dfsg.1-1
Russell Sim [Sat, 29 Jul 2017 16:08:48 +0000 (18:08 +0200)]
Release 0.26.0+dfsg.1-1

7 years agoRemove deps folder (fixes #861752)
Russell Sim [Sat, 29 Jul 2017 16:12:38 +0000 (18:12 +0200)]
Remove deps folder (fixes #861752)

7 years agoEnable GSSAPI Auth
Russell Sim [Sat, 29 Jul 2017 14:59:03 +0000 (16:59 +0200)]
Enable GSSAPI Auth

7 years agoMerge tag 'upstream/0.26.0+dfsg.1'
Russell Sim [Sat, 29 Jul 2017 17:22:48 +0000 (19:22 +0200)]
Merge tag 'upstream/0.26.0+dfsg.1'

Upstream version 0.26.0+dfsg.1

* tag 'upstream/0.26.0+dfsg.1': (367 commits)
  DFSG changes
  CHANGELOG: document git_filter_init and GIT_FILTER_INIT
  Adding git_filter_init for initializing `git_filter` struct + unit test
  adding GIT_FILTER_VERSION to GIT_FILTER_INIT as part of convention
  tests: odb: add more low-level backend tests
  tests: odb: implement `exists_prefix` for the fake backend
  tests: odb: use correct OID length
  tests: odb: have the fake backend detect ambiguous prefixes
  tests: core: test initialization of `git_proxy_options`
  tests: network: add missing include for `git_repository_new`
  cmake: disable optimization on debug builds
  cmake: set "-D_DEBUG" on non-Windows platforms
  cmake: remove stale comment on precompiled headers
  travis: replace use of deprecated homebrew/dupes tap
  travis: install openssl explicitly
  remote: ensure we can create an anon remote on inmemory repo
  repository: don't fail to create config option in inmemory repo
  repository_item_path: return ENOTFOUND when appropriate
  tests: odb: add tests with multiple backends
  tests: odb: allow passing fake objects to the fake backend
  ...

7 years agoDFSG changes
Russell Sim [Sat, 29 Jul 2017 16:38:08 +0000 (18:38 +0200)]
DFSG changes

Remove deps/

7 years agoImported Upstream version 0.26.0
Russell Sim [Sat, 29 Jul 2017 13:51:23 +0000 (15:51 +0200)]
Imported Upstream version 0.26.0

7 years agoRelease 0.25.1.0-1
Russell Sim [Wed, 26 Jul 2017 17:49:09 +0000 (19:49 +0200)]
Release 0.25.1.0-1

7 years agoCHANGELOG: document git_filter_init and GIT_FILTER_INIT
Edward Thomson [Wed, 14 Jun 2017 11:31:20 +0000 (13:31 +0200)]
CHANGELOG: document git_filter_init and GIT_FILTER_INIT

7 years agoMerge pull request #4267 from mohseenrm/master
Edward Thomson [Wed, 14 Jun 2017 08:49:28 +0000 (10:49 +0200)]
Merge pull request #4267 from mohseenrm/master

adding GIT_FILTER_VERSION to GIT_FILTER_INIT as part of convention

7 years agoMerge pull request #4268 from pks-t/pks/homebrew-dupes-deprecation
Edward Thomson [Wed, 14 Jun 2017 08:48:04 +0000 (10:48 +0200)]
Merge pull request #4268 from pks-t/pks/homebrew-dupes-deprecation

travis: replace use of deprecated homebrew/dupes tap

7 years agoMerge pull request #4269 from pks-t/pks/tests
Edward Thomson [Wed, 14 Jun 2017 08:47:55 +0000 (10:47 +0200)]
Merge pull request #4269 from pks-t/pks/tests

Test improvements

7 years agoAdding git_filter_init for initializing `git_filter` struct + unit test
Mohseen Mukaddam [Tue, 13 Jun 2017 18:05:40 +0000 (11:05 -0700)]
Adding git_filter_init for initializing `git_filter` struct + unit test

7 years agoadding GIT_FILTER_VERSION to GIT_FILTER_INIT as part of convention
Mohseen Mukaddam [Mon, 12 Jun 2017 20:40:47 +0000 (13:40 -0700)]
adding GIT_FILTER_VERSION to GIT_FILTER_INIT as part of convention

7 years agotests: odb: add more low-level backend tests
Patrick Steinhardt [Tue, 13 Jun 2017 09:10:19 +0000 (11:10 +0200)]
tests: odb: add more low-level backend tests

Introduce a new test suite "odb::backend::simple", which utilizes the
fake backend to exercise the ODB abstraction layer. While such tests
already exist for the case where multiple backends are put together, no
direct testing for functionality with a single backend exist yet.

7 years agotests: odb: implement `exists_prefix` for the fake backend
Patrick Steinhardt [Tue, 13 Jun 2017 09:39:36 +0000 (11:39 +0200)]
tests: odb: implement `exists_prefix` for the fake backend

The fake backend currently implements all reading functions except for
the `exists_prefix` one. Implement it to enable further testing of the
ODB layer.

7 years agotests: odb: use correct OID length
Patrick Steinhardt [Tue, 13 Jun 2017 09:38:59 +0000 (11:38 +0200)]
tests: odb: use correct OID length

The `search_object` function takes the OID length as one of its
parameters, where its maximum length is `GIT_OID_HEXSZ`. The `exists`
function of the fake backend used `GIT_OID_RAWSZ` though, leading to
only the first half of the OID being used when finding the correct
object.

7 years agotests: odb: have the fake backend detect ambiguous prefixes
Patrick Steinhardt [Tue, 13 Jun 2017 09:38:14 +0000 (11:38 +0200)]
tests: odb: have the fake backend detect ambiguous prefixes

In order to be able to test the ODB prefix functions, we need to be able
to detect ambiguous prefixes in case multiple objects with the same
prefix exist in the fake ODB. Extend `search_object` to detect ambiguous
queries and have callers return its error code instead of always
returning `GIT_ENOTFOUND`.

7 years agotests: core: test initialization of `git_proxy_options`
Patrick Steinhardt [Tue, 13 Jun 2017 09:08:28 +0000 (11:08 +0200)]
tests: core: test initialization of `git_proxy_options`

Initialization of the `git_proxy_options` structure is never tested
anywhere. Include it in our usual initialization test in
"core::structinit::compare".

7 years agotests: network: add missing include for `git_repository_new`
Patrick Steinhardt [Tue, 13 Jun 2017 08:29:23 +0000 (10:29 +0200)]
tests: network: add missing include for `git_repository_new`

A newly added test uses the `git_repository_new` function without the
corresponding header file being included. While this works due to the
compiler deducing the correct function signature, we should obviously
just include the function's declaration file.

7 years agocmake: disable optimization on debug builds
Patrick Steinhardt [Tue, 13 Jun 2017 09:05:09 +0000 (11:05 +0200)]
cmake: disable optimization on debug builds

While our debug builds on MSVC platforms already tune the code optimizer
to aid debugging code, all the other platforms still use the default
optimization level. This makes it hard for developers on these platforms
to actually debug code while maintaining his sanity due to optimizations
like inlined code, elided variables etc.

To help this common use case, we can simply follow the MSVC example and
turn off code optimization with "-O0" for debug builds. While it would
be preferable to instead use "-Og" supported by more modern compilers,
we cannot guarantee that this level is available on all supported
platforms.

7 years agocmake: set "-D_DEBUG" on non-Windows platforms
Patrick Steinhardt [Tue, 13 Jun 2017 09:03:38 +0000 (11:03 +0200)]
cmake: set "-D_DEBUG" on non-Windows platforms

In our code base, we have some occasions where we use the "_DEBUG"
preprocessor macro to enable additional code which should not be part of
release builds. While we define this flag on MSVC platforms, it is
guarded by the conditional `WIN32 AND NOT CYGWIN` on other platforms
since 19be3f9e6 (Improve MSVC compiler, linker flags, 2013-02-13). While
this condition can be fulfilled by the MSVC platform, it is never
encountered due to being part of the `ELSE` part of `IF (MSVC)`.

The intention of the conditional was most likely to avoid the
preprocessor macro on Cygwin platforms, but to include it on everthing
else. As such, the correct condition here would be `IF (NOT CYGWIN)`
instead. But digging a bit further, the condition is only ever used in
two places:

1. To skip the test in "core::structinit", which should also work on
   Cygwin.
2. In "src/win32/git2.rc", where it is used to set additional file
   flags. As this file is included in MSVC builds only, it cannot cause
   any harm to set "_DEBUG" on Cygwin here.

As such, we can simply drop the conditional and always set "-D_DEBUG" on
all platforms.

7 years agocmake: remove stale comment on precompiled headers
Patrick Steinhardt [Tue, 13 Jun 2017 09:08:19 +0000 (11:08 +0200)]
cmake: remove stale comment on precompiled headers

In commit 9f75a9ce7 (Turning on runtime checks when building debug under
MSVC., 2012-03-30), we introduced a comment "Precompiled headers", which
actually refers to no related commands. Seeing that the comment never
had anything to refer to, we can simply remove it here.

7 years agotravis: replace use of deprecated homebrew/dupes tap
Patrick Steinhardt [Tue, 13 Jun 2017 06:09:38 +0000 (08:09 +0200)]
travis: replace use of deprecated homebrew/dupes tap

The formulae provided by the homebrew/dupes tap are deprecated since at
least April 4, 2017, with formulae having been migrated to
homebrew/core.

Replace the deprecated reference to "homebrew/dupes/zlib" with only
"zlib".

7 years agoMerge pull request #4265 from pks-t/pks/read-prefix-tests
Edward Thomson [Mon, 12 Jun 2017 21:47:54 +0000 (22:47 +0100)]
Merge pull request #4265 from pks-t/pks/read-prefix-tests

Read prefix tests

7 years agoMerge pull request #4263 from libgit2/ethomson/config_for_inmemory_repo
Edward Thomson [Mon, 12 Jun 2017 20:23:44 +0000 (21:23 +0100)]
Merge pull request #4263 from libgit2/ethomson/config_for_inmemory_repo

Allow creation of a configuration object in an in-memory repository

7 years agoMerge pull request #4266 from libgit2/ethomson/travis-explicit-openssl
Edward Thomson [Mon, 12 Jun 2017 20:22:27 +0000 (21:22 +0100)]
Merge pull request #4266 from libgit2/ethomson/travis-explicit-openssl

travis: install openssl explicitly

7 years agotravis: install openssl explicitly
Edward Thomson [Mon, 12 Jun 2017 19:00:21 +0000 (20:00 +0100)]
travis: install openssl explicitly

7 years agoremote: ensure we can create an anon remote on inmemory repo
Edward Thomson [Mon, 12 Jun 2017 11:00:14 +0000 (12:00 +0100)]
remote: ensure we can create an anon remote on inmemory repo

Given a wholly in-memory repository, ensure that we can create an
anonymous remote and perform actions on it.

7 years agorepository: don't fail to create config option in inmemory repo
Edward Thomson [Mon, 12 Jun 2017 11:02:27 +0000 (12:02 +0100)]
repository: don't fail to create config option in inmemory repo

When in an in-memory repository - without a configuration file - do not
fail to create a configuration object.

7 years agorepository_item_path: return ENOTFOUND when appropriate
Edward Thomson [Mon, 12 Jun 2017 11:01:10 +0000 (12:01 +0100)]
repository_item_path: return ENOTFOUND when appropriate

Disambiguate error values: return `GIT_ENOTFOUND` when the item cannot
exist in the repository (perhaps because the repository is inmemory or
otherwise not backed by a filesystem), return `-1` when there is a hard
failure.

7 years agotests: odb: add tests with multiple backends
Patrick Steinhardt [Mon, 12 Jun 2017 14:19:45 +0000 (16:19 +0200)]
tests: odb: add tests with multiple backends

Previous to pulling out and extending the fake backend, it was quite
cumbersome to write tests for very specific scenarios regarding
backends. But as we have made it more generic, it has become much easier
to do so. As such, this commit adds multiple tests for scenarios with
multiple backends for the ODB.

The changes also include a test for a very targeted scenario. When one
backend found a matching object via `read_prefix`, but the last backend
returns `GIT_ENOTFOUND` and when object hash verification is turned off,
we fail to reset the error code to `GIT_OK`. This causes us to segfault
later on, when doing a double-free on the returned object.

7 years agotests: odb: allow passing fake objects to the fake backend
Patrick Steinhardt [Mon, 12 Jun 2017 13:43:56 +0000 (15:43 +0200)]
tests: odb: allow passing fake objects to the fake backend

Right now, the fake backend is quite restrained in the way how it
works: we pass it an OID which it is to return later as well as an error
code we want it to return. While this is sufficient for existing tests,
we can make the fake backend a little bit more generic in order to allow
us testing for additional scenarios.

To do so, we change the backend to not accept an error code and OID
which it is to return for queries, but instead a simple array of OIDs
with their respective blob contents. On each query, the fake backend
simply iterates through this array and returns the first matching
object.

7 years agotests: do not reuse OID from backend
Patrick Steinhardt [Mon, 12 Jun 2017 13:21:58 +0000 (15:21 +0200)]
tests: do not reuse OID from backend

In order to make the fake backend more useful, we want to enable it
holding multiple object references. To do so, we need to decouple it
from the single fake OID it currently holds, which we simply move up
into the calling tests.

7 years agotests: odb: move fake backend into its own file
Patrick Steinhardt [Mon, 12 Jun 2017 12:53:46 +0000 (14:53 +0200)]
tests: odb: move fake backend into its own file

The fake backend used by the test suite `odb::backend::nonrefreshing` is
useful to have some low-level tests for the ODB layer. As such, we move
the implementation into its own `backend_helpers` module.

7 years agoMerge pull request #4261 from RogerGee/fix_wait_while_ack
Edward Thomson [Mon, 12 Jun 2017 15:01:22 +0000 (16:01 +0100)]
Merge pull request #4261 from RogerGee/fix_wait_while_ack

smart_protocol: fix parsing of server ACK responses

7 years agoMerge pull request #4264 from libgit2/ethomson/read_prefix
Patrick Steinhardt [Mon, 12 Jun 2017 14:33:41 +0000 (07:33 -0700)]
Merge pull request #4264 from libgit2/ethomson/read_prefix

odb_read_prefix: reset error in backends loop

7 years agoodb_read_prefix: reset error in backends loop
Edward Thomson [Mon, 12 Jun 2017 11:56:40 +0000 (12:56 +0100)]
odb_read_prefix: reset error in backends loop

When looking for an object by prefix, we query all the backends so that
we can ensure that there is no ambiguity.  We need to reset the `error`
value between backends; otherwise the first backend may find an object
by prefix, but subsequent backends may not.  If we do not reset the
`error` value then it will remain at `GIT_ENOTFOUND` and `read_prefix_1`
will fail, despite having actually found an object.

7 years agorepository_item_path: error messages lowercased
Edward Thomson [Mon, 12 Jun 2017 10:45:09 +0000 (11:45 +0100)]
repository_item_path: error messages lowercased

7 years agoMerge pull request #4262 from libgit2/ethomson/bump-v26
Edward Thomson [Sun, 11 Jun 2017 11:32:00 +0000 (12:32 +0100)]
Merge pull request #4262 from libgit2/ethomson/bump-v26

Update version number to 0.26

7 years agoUpdate version number to v0.26
Edward Thomson [Sun, 11 Jun 2017 11:23:34 +0000 (12:23 +0100)]
Update version number to v0.26

7 years agochangelog: add some final 0.26 changes
Edward Thomson [Sun, 11 Jun 2017 11:21:23 +0000 (12:21 +0100)]
changelog: add some final 0.26 changes

7 years agoMerge pull request #4254 from pks-t/pks/changelog-v0.26
Edward Thomson [Sun, 11 Jun 2017 09:58:35 +0000 (10:58 +0100)]
Merge pull request #4254 from pks-t/pks/changelog-v0.26

CHANGELOG: add various changes introduced since v0.25

7 years agoMerge pull request #4088 from chescock/packfile-name-using-complete-hash
Edward Thomson [Sun, 11 Jun 2017 09:37:46 +0000 (10:37 +0100)]
Merge pull request #4088 from chescock/packfile-name-using-complete-hash

Ensure packfiles with different contents have different names

7 years agoMerge pull request #4260 from libgit2/ethomson/forced_checkout_2
Edward Thomson [Sun, 11 Jun 2017 08:54:04 +0000 (09:54 +0100)]
Merge pull request #4260 from libgit2/ethomson/forced_checkout_2

Update to forced checkout and untracked files

7 years agogit_futils_rmdir: only allow `EBUSY` when asked
Edward Thomson [Sat, 10 Jun 2017 17:46:35 +0000 (18:46 +0100)]
git_futils_rmdir: only allow `EBUSY` when asked

Only ignore `EBUSY` from `rmdir` when the `GIT_RMDIR_SKIP_NONEMPTY` bit
is set.

7 years agocheckout: cope with untracked files in directory deletion
Edward Thomson [Thu, 8 Jun 2017 21:23:53 +0000 (22:23 +0100)]
checkout: cope with untracked files in directory deletion

When deleting a directory during checkout, do not simply delete the
directory, since there may be untracked files.  Instead, go into
the iterator and examine each file.

In the original code (the code with the faulty assumption), we look to
see if there's an index entry beneath the directory that we want to
remove.   Eg, it looks to see if we have a workdir entry foo and an
index entry foo/bar.txt. If this is not the case, then the working
directory must have precious files in that directory. This part is okay.
The part that's not okay is if there is an index entry foo/bar.txt. It
just blows away the whole damned directory.

That's not cool.

Instead, by simply pushing the directory itself onto the stack and
iterating each entry, we will deal with the files one by one - whether
they're in the index (and can be force removed) or not (and are
precious).

The original code was a bad optimization, assuming that we didn't need
to git_iterator_advance_into if there was any index entry in the folder.
That's wrong - we could have optimized this iff all folder entries are
in the index.

Instead, we need to simply dig into the directory and analyze its
entries.

7 years agocheckout: do not delete directories with untracked entries
Patrick Steinhardt [Wed, 15 Feb 2017 13:05:10 +0000 (14:05 +0100)]
checkout: do not delete directories with untracked entries

If the `GIT_CHECKOUT_FORCE` flag is given to any of the `git_checkout`
invocations, we remove files which were previously staged. But while
doing so, we unfortunately also remove unstaged files in a directory
which contains at least one staged file, resulting in potential data
loss.

This commit adds two tests to verify behavior.

7 years agosmart_protocol: fix parsing of server ACK responses
Roger Gee [Sat, 10 Jun 2017 16:46:09 +0000 (11:46 -0500)]
smart_protocol: fix parsing of server ACK responses

Fix ACK parsing in wait_while_ack() internal function. This patch
handles the case where multi_ack_detailed mode sends 'ready' ACKs. The
existing functionality would bail out too early, thus causing the
processing of the ensuing packfile to fail if/when 'ready' ACKs were
sent.

7 years agoCHANGELOG: add various changes introduced since v0.25
Patrick Steinhardt [Wed, 7 Jun 2017 06:32:41 +0000 (08:32 +0200)]
CHANGELOG: add various changes introduced since v0.25

7 years agoMerge pull request #4259 from pks-t/pks/fsync-option-rename
Edward Thomson [Thu, 8 Jun 2017 20:54:30 +0000 (22:54 +0200)]
Merge pull request #4259 from pks-t/pks/fsync-option-rename

settings: rename `GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION`

7 years agosettings: rename `GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION`
Patrick Steinhardt [Thu, 8 Jun 2017 19:40:18 +0000 (21:40 +0200)]
settings: rename `GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION`

Initially, the setting has been solely used to enable the use of
`fsync()` when creating objects. Since then, the use has been extended
to also cover references and index files. As the option is not yet part
of any release, we can still correct this by renaming the option to
something more sensible, indicating not only correlation to objects.

This commit renames the option to `GIT_OPT_ENABLE_FSYNC_GITDIR`. We also
move the variable from the object to repository source code.

7 years agoMerge pull request #4255 from pks-t/pks/buffer-grow-errors
Edward Thomson [Thu, 8 Jun 2017 12:22:24 +0000 (14:22 +0200)]
Merge pull request #4255 from pks-t/pks/buffer-grow-errors

Buffer growing cleanups

7 years agoMerge pull request #4253 from pks-t/pks/cov-fixes
Edward Thomson [Thu, 8 Jun 2017 11:56:22 +0000 (13:56 +0200)]
Merge pull request #4253 from pks-t/pks/cov-fixes

Coverity fixes

7 years agorefdb_fs: be explicit about using null-OID if we cannot resolve ref
Patrick Steinhardt [Tue, 6 Jun 2017 13:02:23 +0000 (15:02 +0200)]
refdb_fs: be explicit about using null-OID if we cannot resolve ref

7 years agopath: only set dotgit flags when configs were read
Patrick Steinhardt [Tue, 6 Jun 2017 12:57:31 +0000 (14:57 +0200)]
path: only set dotgit flags when configs were read

7 years agoworktree: use `git__free` instead of `free`
Patrick Steinhardt [Tue, 6 Jun 2017 12:54:48 +0000 (14:54 +0200)]
worktree: use `git__free` instead of `free`

7 years agorefs: properly report errors from `update_wt_heads`
Patrick Steinhardt [Tue, 6 Jun 2017 12:54:19 +0000 (14:54 +0200)]
refs: properly report errors from `update_wt_heads`

7 years agofileops: check return value of `git_path_dirname`
Patrick Steinhardt [Tue, 6 Jun 2017 12:53:45 +0000 (14:53 +0200)]
fileops: check return value of `git_path_dirname`

7 years agobuffer: use `git_buf_init` with length
Patrick Steinhardt [Wed, 7 Jun 2017 08:20:44 +0000 (10:20 +0200)]
buffer: use `git_buf_init` with length

The `git_buf_init` function has an optional length parameter, which will
cause the buffer to be initialized and allocated in one step. This can
be used instead of static initialization with `GIT_BUF_INIT` followed by
a `git_buf_grow`. This patch does so for two functions where it is
applicable.

7 years agobuffer: return errors for `git_buf_init` and `git_buf_attach`
Patrick Steinhardt [Wed, 7 Jun 2017 07:56:31 +0000 (09:56 +0200)]
buffer: return errors for `git_buf_init` and `git_buf_attach`

Both the `git_buf_init` and `git_buf_attach` functions may call
`git_buf_grow` in case they were given an allocation length as
parameter. As such, it is possible for these functions to fail when we
run out of memory. While it won't probably be used anytime soon, it does
indeed make sense to also record this fact by returning an error code
from both functions. As they belong to the internal API only, this
change does not break our interface.

7 years agobuffer: consistently use `ENSURE_SIZE` to grow buffers on-demand
Patrick Steinhardt [Wed, 7 Jun 2017 07:50:54 +0000 (09:50 +0200)]
buffer: consistently use `ENSURE_SIZE` to grow buffers on-demand

The `ENSURE_SIZE` macro can be used to grow a buffer if its currently
allocated size does not suffice a required target size. While most of
the code already uses this macro, the `git_buf_join` and `git_buf_join3`
functions do not yet use it. Due to the macro first checking whether we
have to grow the buffer at all, this has the benefit of saving a
function call when it is not needed. While this is nice to have, it will
probably not matter at all performance-wise -- instead, this only serves
for consistency across the code.

7 years agobuffer: fix `ENSURE_SIZE` macro referencing wrong variable
Patrick Steinhardt [Thu, 8 Jun 2017 09:52:32 +0000 (11:52 +0200)]
buffer: fix `ENSURE_SIZE` macro referencing wrong variable

While the `ENSURE_SIZE` macro gets a reference to both the buffer that
is to be resized and a new size, we were not consistently referencing
the passed buffer, but instead a variable `buf`, which is not passed in.
Funnily enough, we never noticed because our buffers seem to always be
named `buf` whenever the macro was being used.

Fix the macro by always using the passed-in buffer. While at it, add
braces around all mentions of passed-in variables as should be done with
macros to avoid subtle errors.

Found-by: Edward Thompson
7 years agobuffer: rely on `GITERR_OOM` set by `git_buf_try_grow`
Patrick Steinhardt [Wed, 7 Jun 2017 08:05:54 +0000 (10:05 +0200)]
buffer: rely on `GITERR_OOM` set by `git_buf_try_grow`

The function `git_buf_try_grow` consistently calls `giterr_set_oom`
whenever growing the buffer fails due to insufficient memory being
available. So in fact, we do not have to do this ourselves when a call
to any buffer-growing function has failed due to an OOM situation. But
we still do so in two functions, which this patch cleans up.

7 years agoMerge pull request #4258 from pks-t/pks/sha1dc-update
Edward Thomson [Thu, 8 Jun 2017 08:55:47 +0000 (10:55 +0200)]
Merge pull request #4258 from pks-t/pks/sha1dc-update

SHA1DC update

7 years agosha1dc: do not use standard includes
Patrick Steinhardt [Wed, 7 Jun 2017 12:59:38 +0000 (14:59 +0200)]
sha1dc: do not use standard includes

The updated SHA1DC library allows us to use custom includes instead of
using standard includes. Due to requirements with cross-platform, we
provide some custom system includes files like for example the
"stdint.h" file on Win32. Because of this, we want to make sure to avoid
breaking cross-platform compatibility when SHA1DC is enabled.

To use the new mechanism, we can simply define
`SHA1DC_NO_STANDARD_INCLUDES`. Furthermore, we can specify custom
include files via two defines, which we now use to include our
"common.h" header.

7 years agosha1dc: update to fix errors with endianess and unaligned access
Patrick Steinhardt [Wed, 7 Jun 2017 12:50:16 +0000 (14:50 +0200)]
sha1dc: update to fix errors with endianess and unaligned access

This updates our version of SHA1DC to e139984 (Merge pull request #35
from lidl/master, 2017-05-30).

7 years agoMerge pull request #4236 from pks-t/pks/index-v4-fixes
Edward Thomson [Wed, 7 Jun 2017 12:42:12 +0000 (14:42 +0200)]
Merge pull request #4236 from pks-t/pks/index-v4-fixes

Fix path computations for compressed index entries

7 years agoMerge pull request #4256 from libgit2/ethomson/unc_tests
Edward Thomson [Wed, 7 Jun 2017 11:56:22 +0000 (13:56 +0200)]
Merge pull request #4256 from libgit2/ethomson/unc_tests

(Temporarily) disable UNC tests