Commit Graph

2717 Commits

Author SHA1 Message Date
Russell Belfer
39b8e047b4 Missed a couple of khash inline dependencies 2012-07-12 11:52:10 -07:00
Russell Belfer
72ee078762 Isolate khash inlines from global namespace
khash.h was globally #define'ing "inline" which messes with
other files.  Let's keep it as "kh_inline".
2012-07-12 11:49:15 -07:00
Carlos Martín Nieto
b7158c53a4 Use GIT_INLINE instead of inline 2012-07-12 20:48:46 +02:00
Carlos Martín Nieto
eca67c585e tests: fix git_odb_foreach() object count
Some objects were added in another PR
2012-07-12 20:40:09 +02:00
Carlos Martín Nieto
1ebe432e2f commit: properly export git_commit_nth_gen_ancestor() 2012-07-12 20:33:30 +02:00
Vicent Martí
dd4345b424 Merge pull request #789 from carlosmn/odb-foreach
odb: add git_odb_foreach()
2012-07-12 09:42:54 -07:00
Vicent Martí
0cf6b2f29e Merge pull request #805 from nulltoken/fix/revwalk-email-parsing
Fix revwalk email parsing
2012-07-12 09:37:09 -07:00
Vicent Martí
db2d4061f6 Merge pull request #814 from nulltoken/topic/revparse-refac
Revparse refactoring: a start
2012-07-12 09:35:35 -07:00
Vicent Martí
48bcf81dd2 Merge pull request #812 from arrbee/assorted-tweaks
Assorted goodies
2012-07-12 09:32:44 -07:00
nulltoken
12595ab8f9 revparse: deploy git_reference_remote_tracking_from_branch() 2012-07-12 01:06:13 +02:00
nulltoken
84f18e3587 refs: introduce git_reference_remote_tracking_from_branch() 2012-07-12 01:06:13 +02:00
nulltoken
874303d468 refs: readonly tests don't need a sandboxed repo 2012-07-12 01:06:12 +02:00
nulltoken
2d012c0c72 revparse: deploy git_commit_nth_gen_ancestor() 2012-07-12 01:06:12 +02:00
nulltoken
b1aca6eae0 commit: introduce git_commit_nth_gen_ancestor() 2012-07-12 01:06:11 +02:00
nulltoken
2b92a154b6 commit: reduce code duplication 2012-07-12 01:06:11 +02:00
nulltoken
8f17ed801f revparse: simplify the parsing of described object 2012-07-12 01:06:10 +02:00
nulltoken
8aedf1d558 signature: prevent angle bracket usage in identity 2012-07-11 20:40:13 +02:00
nulltoken
118cf57d42 revwalk: relax the parsing of the commit time 2012-07-11 20:40:12 +02:00
nulltoken
5b07111529 tests: add test commit with angle brackets in the author name 2012-07-11 20:40:12 +02:00
Vicent Marti
111ee3fe2d Add missing includes 2012-07-11 14:37:26 +02:00
Vicent Martí
a13a30ac30 Merge pull request #801 from nulltoken/fix/ref-renaming
refs and revparse love <3
2012-07-11 05:29:51 -07:00
Russell Belfer
54e29b9380 Fix missing NUL termination of buffer 2012-07-10 23:51:32 -07:00
Russell Belfer
991a56c704 Add flag to write gitlink on setting repo workdir
This added a flag to the `git_repository_set_workdir()` function
that enables generation of a `.git` gitlink file that links the
new workdir to the parent repository.  Essentially, the flag tells
the function to write out the changes to disk to permanently set
the workdir of the repository to the new path.

If you pass this flag as true, then setting the workdir to something
other than the default workdir (i.e. the parent of the .git repo
directory), will create a plain file named ".git" with the standard
gitlink contents "gitdir: <repo-path>", and also update the
"core.worktree" and "core.bare" config values.

Setting the workdir to the default repo workdir will clear the
core.worktree flag (but still permanently set core.bare to false).

BTW, the libgit2 API does not currently provide a function for
clearing the workdir and converting a non-bare repo into a bare one.
2012-07-10 23:19:47 -07:00
Russell Belfer
b3ff1dab31 Adding git_config_foreach_match() iteration fn
Adding a new config iteration function that let's you iterate
over just the config entries that match a particular regular
expression.  The old foreach becomes a simple use of this with
an empty pattern.

This also fixes an apparent bug in the existing `git_config_foreach`
where returning a non-zero value from the iteration callback was
not correctly aborting the iteration and the returned value was
not being propogated back to the caller of foreach.

Added to tests to cover all these changes.
2012-07-10 23:19:47 -07:00
Russell Belfer
c3a875c975 Adding unicode space to match crlf patterns
Adding 0x85 to `git__isspace` since we also look for that in filter.c
as a whitespace character.
2012-07-10 23:19:47 -07:00
Russell Belfer
b0fe112922 Add path utilities to resolve relative paths
This makes it easy to take a buffer containing a path with relative
references (i.e. .. or . path segments) and resolve all of those
into a clean path.  This can be applied to URLs as well as file
paths which can be useful.

As part of this, I made the drive-letter detection apply on all
platforms, not just windows.  If you give a path that looks like
"c:/..." on any platform, it seems like we might as well detect
that as a rooted path.  I suppose if you create a directory named
"x:" on another platform and want to use that as the beginning
of a relative path under the root directory of your repo, this
could cause a problem, but then it seems like you're asking for
trouble.
2012-07-10 23:19:47 -07:00
Russell Belfer
039fc40679 Add a couple of useful git_buf utilities
* `git_buf_rfind` (with tests and tests for `git_buf_rfind_next`)
* `git_buf_puts_escaped` and `git_buf_puts_escaped_regex` (with tests)
  to copy strings into a buffer while injecting an escape sequence
  (e.g. '\') in front of particular characters.
2012-07-10 23:19:47 -07:00
Russell Belfer
6b9a49cd5f Updating language in examples README 2012-07-10 21:50:36 -07:00
Russell Belfer
b173cda5bf Merge pull request #804 from schu/examples-readme
examples: add README
2012-07-10 21:46:40 -07:00
Russell Belfer
4d3a7b7846 Merge pull request #793 from libgit2/tree-entry-by-path
Bring back `entry_bypath`
2012-07-10 21:45:16 -07:00
Russell Belfer
19017a24e3 Merge pull request #797 from yorah/fix/inter-hunk-context
diff: make inter-hunk-context default value git-compliant
2012-07-10 16:24:17 -07:00
Russell Belfer
6f41aeab11 Merge pull request #811 from nacho/development
Point to the libgit2-glib wiki page
2012-07-10 15:49:51 -07:00
Michael Schubert
13f9eb242d examples: add README 2012-07-10 14:56:54 +02:00
Russell Belfer
1de11acafb Merge pull request #810 from Steap/development
Fix libgit2 on GNU/Hurd.
2012-07-09 21:49:34 -07:00
Ignacio Casal Quinteiro
a7a2fccd83 Point to the libgit2-glib wiki page 2012-07-09 13:12:16 +02:00
nulltoken
3e82d6c6f0 revparse: unfound reference return ENOTFOUND 2012-07-07 12:16:15 +02:00
nulltoken
ce9e8e11ca revparse: fix invalid test reference name 2012-07-07 12:16:14 +02:00
nulltoken
b8460c2015 revparse: do not segfault when retrieving the last entry 2012-07-07 12:16:14 +02:00
nulltoken
e727938112 revparse: fix disambiguation of refs 2012-07-07 12:16:13 +02:00
nulltoken
805c81594d revparse: unfound previous head return ENOTFOUND 2012-07-07 12:16:12 +02:00
nulltoken
3d78ab6427 revparse: split reflog test per feature 2012-07-07 12:16:12 +02:00
nulltoken
3cd90893a0 revparse: enhance upstream reflog test coverage 2012-07-07 12:16:11 +02:00
nulltoken
35bed94fd5 revparse: enhance refs/<name> coverage 2012-07-07 12:16:10 +02:00
nulltoken
6a5136e538 revparse: only allow decimal reflog ordinal specs
passing 0 to git_strol(32|64) let the implementation guess if it's
dealing with an octal number or a decimal one.

Let's make it safe and ensure that both 'HEAD@{010}' and 'HEAD@{10}'
point at the same commit.
2012-07-07 12:16:10 +02:00
nulltoken
29f72aa638 revparse: leverage git__isdigit() 2012-07-07 12:16:09 +02:00
nulltoken
98d6a1fdda util: add git__isdigit() 2012-07-07 12:16:09 +02:00
nulltoken
cab65c2b23 revparse: detect incorrect "refname@{-n}" syntax 2012-07-07 12:16:08 +02:00
nulltoken
1decf88bc1 revparse: slightly improve readability of tests 2012-07-07 12:16:08 +02:00
nulltoken
34922eeeed revparse: readonly tests don't need a sandboxed repo 2012-07-07 12:16:07 +02:00
nulltoken
d0a920a6fd refs: deep unfound ref returns ENOTFOUND 2012-07-07 12:15:30 +02:00