Commit Graph

4865 Commits

Author SHA1 Message Date
Carlos Martín Nieto
69a3c766b6 refdb_fs: don't crash when the repo doesn't have a path 2013-05-11 11:20:37 +02:00
Carlos Martín Nieto
4def7035ca refs: introduce an iterator
This allows us to get a list of reference names in a loop instead of callbacks.
2013-05-11 11:20:37 +02:00
Vicent Martí
4a65aead2c Merge pull request #1571 from arrbee/what-if-ignorecase-lies
Improve ignore handling in git_status_file
2013-05-10 10:49:22 -07:00
Vicent Martí
c3a5171198 Merge pull request #1572 from arrbee/diff-patch-with-rename
Fix diff output for renames and copies
2013-05-10 10:47:08 -07:00
Ben Straub
94d24ac93f Merge pull request #1573 from nulltoken/fix/leaks
Fix some memory leaks
2013-05-10 10:33:25 -07:00
nulltoken
249888948f Fix some memory leaks 2013-05-10 19:22:47 +02:00
Russell Belfer
e9ba61f399 Fix diff output for renames and copies
If you use rename detection, the renamed and copied files would
not show any text diffs because the function that decides if
data should be loaded didn't know which sides of the diff to
load for those cases.

This adds a test that looks at the patch generated for diff
entries that are COPIED or RENAMED.
2013-05-10 09:32:42 -07:00
Russell Belfer
1f9e41ee86 Improve ignore handling in git_status_file
The git_status_file API was doing a hack to deal with files that
are inside ignored directories.  The status scan was not reporting
any file in this case, so git_status_file would attempt a final
"stat()" call, and return IGNORED if the file actually existed.

On case-insensitive filesystems where core.ignorecase is set
incorrectly, this magic check can "succeed" and report a file
as ignored when it should actually return ENOTFOUND.

Now that we have the GIT_STATUS_OPT_RECURSE_IGNORED_DIRS, we can
use that flag to make sure that git_status_file() will look into
ignored directories and eliminate the hack completely, so we give
the correct error.
2013-05-10 07:50:53 -07:00
Brad Morgan
89ea0e5181 Removed ifdef 2013-05-10 09:40:14 -04:00
Michael Schubert
ae59321fb8 clone: fix -Wmaybe-uninitialized warning 2013-05-10 14:46:14 +02:00
Brad Morgan
b4d81a00bf Moved libssh2 sign callback into typedef 2013-05-09 17:40:21 -04:00
Brad Morgan
ce6d50b994 Changed to use libssh2_channel_exec 2013-05-09 17:37:42 -04:00
Brad Morgan
05f581311b Renaming 2013-05-09 17:36:27 -04:00
Vicent Martí
aca2d26a5c Merge pull request #1566 from ethomson/ref_zero
calloc refs instead of malloc'ing them
2013-05-09 09:08:44 -07:00
Edward Thomson
617bb17556 calloc refs instead of malloc'ing them 2013-05-09 17:44:44 +02:00
Vicent Martí
9ca4ff41eb Merge pull request #1563 from arrbee/doc-fix-repo-message
Fix git_repository_message docs
2013-05-09 06:48:16 -07:00
Russell Belfer
3d1c9f612d Fix git_repository_message docs
This clarifies the docs for git_repository_message and also adds
to the tests to explicitly check NUL termination of data when the
output buffer is smaller than the message size.  There is a minor
behavior change so that a non-NULL output buffer will always be
NUL terminated (at length zero) if an error occurs.
2013-05-09 06:45:06 -07:00
Vicent Martí
503dd0f3c4 Merge pull request #1560 from carlosmn/ref-dwim
Expose git_reference_dwim
2013-05-09 05:43:25 -07:00
Vicent Martí
ddc5c05421 Merge pull request #1561 from arrbee/fix-windows-diff-eofnl
Fix windows diff eofnl error
2013-05-09 05:42:37 -07:00
Russell Belfer
eb05b114e1 Fix dumb type in time comparison 2013-05-07 22:45:01 -07:00
Vicent Martí
af795759a7 Merge pull request #1552 from carlosmn/config-helpers
Config helpers for global/xdg config files
2013-05-07 15:09:11 -07:00
Carlos Martín Nieto
98d633cccf Expose git_reference_dwim
Extract this function out of the rev-parse code to be able to DWIM a
reference instead of its target.
2013-05-07 23:34:48 +02:00
Carlos Martín Nieto
5d8318875f config: convenience function to open global/xdg
The rules for which one to open is a bit silly, so let's make it
easier for our users.
2013-05-07 21:42:56 +02:00
Carlos Martín Nieto
a4b75dcf56 repo: unconditionally create a global config backend
When a repository is initialised, we need to probe to see if there is
a global config to load. If this is not the case, the user isn't able
to write to the global config without creating the backend and adding
it themselves, which is inconvenient and overly complex.

Unconditionally create and add a backend for the global config file
regardless of whether it exists as a convenience for users.

To enable this, we allow creating backends to files that do not exist
yet, changing the semantics somewhat, and making some tests invalid.
2013-05-07 21:42:56 +02:00
Brad Morgan
4ca3d6d28f Added ifdef 2013-05-07 14:37:15 -04:00
Brad Morgan
00e43380a0 Merge remote-tracking branch 'origin/development' into ssh_transport 2013-05-07 14:30:35 -04:00
Brad Morgan
7369b3c3bf Added libssh2 cmake module 2013-05-07 14:26:33 -04:00
Brad Morgan
574b86b722 Fixed compilation issues when libssh2 is missing 2013-05-07 13:56:34 -04:00
Brad Morgan
c36565c0ee Added SSH public key authentication 2013-05-07 13:45:31 -04:00
Vicent Martí
d6465e1a7d Merge pull request #1557 from carlosmn/tagopt
remote: correctly interpret tagopt '--tags'
2013-05-07 10:14:28 -07:00
Russell Belfer
0f938c6b8f Fix win32 type warnings 2013-05-07 09:59:53 -07:00
Carlos Martín Nieto
505b5d0c81 remote: correctly interpret tagopt '--tags'
When tagopt is set to '--tags', we should only take the default tags
refspec into account and ignore any configured ones.

Bring the code into compliance.
2013-05-07 18:49:47 +02:00
Vicent Martí
33665410d6 Merge pull request #1556 from arrbee/diff-patch-fixes
Diff patch bug fixes
2013-05-07 08:00:44 -07:00
Russell Belfer
c2f602f8a5 Fix line numbering for patches with eofnl
When a patch contained an eofnl change (i.e. the last line either
gained or lost a newline), the oldno and newno line number values
for the lines in the last hunk of the patch were not useful.  This
makes them behave in a more expected manner.
2013-05-07 07:15:39 -07:00
Russell Belfer
d63eec6946 Improve diff function docs 2013-05-07 04:44:08 -07:00
Russell Belfer
fd96f98e14 More tests for files with no newline at end 2013-05-07 04:36:42 -07:00
Russell Belfer
e35e2684f6 Add GIT_DIFF_LINE_CONTEXT_EOFNL
This adds a new line origin constant for the special line that
is used when both files end without a newline.

In the course of writing the tests for this, I was having problems
with modifying a file but not having diff notice because it was
the same size and modified less than one second from the start of
the test, so I decided to start working on nanosecond timestamp
support.  This commit doesn't contain the nanosecond support, but
it contains the reorganization of maybe_modified and the hooks so
that if the nanosecond data were being read by stat() (or rather
being copied by git_index_entry__init_from_stat), then the nsec
would be taken into account.

This new stuff could probably use some more tests, although there
is some amount of it here.
2013-05-07 04:32:17 -07:00
Carlos Martín Nieto
1c92f1090e Merge pull request #1551 from nvloff/set_upstream_local_branch
fix git_branch_set_upstream for local branches
2013-05-07 01:32:10 -07:00
Russell Belfer
51e297dd18 Merge pull request #1554 from sba1/sort-amiga-fix
Fixed qsort_r() problem when targeting AmigaOS.
2013-05-07 00:31:40 -07:00
Sebastian Bauer
7f8cf6fefd Fixed qsort_r() problem when targeting AmigaOS.
We fall back to the libgit2-provided insert sort as done for other
platforms.
2013-05-07 09:15:12 +02:00
Russell Belfer
590991a7e0 Merge pull request #1553 from jdavid/git_commit_owner
Add git_commit_owner to the public interface
2013-05-06 23:25:06 -07:00
J. David Ibáñez
6e8659969a Add git_commit_owner to the public interface
Just like git_tree_owner, etc.
2013-05-07 07:33:35 +02:00
Nikolai Vladimirov
3d42e9a31e git_branch_set_upstream with local branches
Currently git_branch_set_upstream when passed a local branch
creates invalid configuration, for ex. if we setup branch
'tracking_master' to track local 'master' libgit2 generates
the following config

```
[branch "track_master"]
  remote = .
  merge = .refs/heads/track_master
```

The merge value is invalid and calling git_branch_upstream on
'tracking_master' results in invalid reference error.

It should do:

```
[branch "track_master"]
  remote = .
  merge = refs/heads/master
```
2013-05-06 20:33:11 +03:00
Vicent Martí
3405f78754 Merge pull request #1547 from ethomson/win32_stat
p_stat() should follow symlinks on windows
2013-05-06 06:51:21 -07:00
Vicent Martí
03c28d92d0 Merge pull request #1526 from arrbee/cleanup-error-return-without-msg
Make sure error messages are set for most error returns
2013-05-06 06:45:53 -07:00
Vicent Martí
d5e5bbd719 Merge pull request #1524 from jamill/clone_tagopts
By default do not set tagopt when cloning
2013-05-06 06:45:40 -07:00
Vicent Martí
450a78bf07 Merge pull request #1545 from ethomson/checkout_dirs_in_use
allow checkout to proceed when a dir to be removed is in use (win32)
2013-05-06 06:33:02 -07:00
Russell Belfer
0ed3fa8a37 Merge pull request #1550 from nvloff/fix_typo_in_branch_h
branch.h: fix typo in docs
2013-05-06 05:53:13 -07:00
Nikolai Vladimirov
72662202ac branch.h: fix typo in docs 2013-05-06 15:31:26 +03:00
Brad Morgan
7621519f73 Cleanup 2013-05-05 14:46:28 -04:00