Carlos Martín Nieto
b25d87c9cd
branch: move to git_buf when outputting newly-allocated strings
...
Internally we already did everything with git_bufs, so this is just
exposing those functions with public names.
2014-01-27 04:44:05 +01:00
Carlos Martín Nieto
7a3bd1e732
repository: move to use a git_buf for outputting strings
...
Since we now export that type, we can avoid making the user guess a
size.
2014-01-27 04:44:05 +01:00
Arthur Schreiber
991b2840eb
Make sure git_remote_dup copies a remote's refspecs correctly.
2014-01-26 19:35:02 +01:00
Arthur Schreiber
11f6ad5fcf
Add some missing const declarations.
2014-01-26 18:08:05 +01:00
Edward Thomson
93b96ea705
Merge pull request #2076 from xtao/fix-zstream
...
Fix write_object.
2014-01-26 06:38:02 -08:00
Edward Thomson
58582cd0b0
Merge pull request #2057 from GrahamDennis/local-file-url-push-fix
...
Fix local push to file:// URL.
2014-01-26 06:31:38 -08:00
XTao
1cb5a81194
Fix write_object.
2014-01-26 22:26:53 +08:00
Vicent Marti
ca55fc6356
Merge pull request #2074 from linquize/pack-filename-sha1
...
Drop parsing pack filename SHA1 part
2014-01-23 08:03:29 -08:00
Linquize
8610487cd3
Drop parsing pack filename SHA1 part, no one cares the filename
2014-01-23 23:28:28 +08:00
Vicent Marti
ac8949edb2
Merge pull request #2073 from ethomson/zerobytes
...
Sometimes a zero byte file is just a zero byte file
2014-01-22 15:41:25 -08:00
Edward Thomson
410a8e6fed
Sometimes a zero byte file is just a zero byte file
...
Don't go to the ODB to resolve zero byte files in the workdir
2014-01-22 18:31:25 -05:00
Ben Straub
ab4bcc038a
Plug a small memory leak
2014-01-22 14:14:37 -08:00
Edward Thomson
238e814972
Summarize empty messages
2014-01-22 14:41:04 -05:00
Edward Thomson
e8b81c698c
Preserve tree filemode in index during checkout
...
Don't try to determine whether the system supports file modes
when putting the tree data in the index during checkout. The tree's
mode is canonical and did not come from stat(2) in the first place.
2014-01-22 13:26:30 -05:00
Nicolas Hake
c05cd7924d
Drop git_patch_to_str
...
It's hard or even impossible to correctly free the string buffer
allocated by git_patch_to_str in some circumstances. Drop the function
so people have to use git_patch_to_buf instead - git_buf has a dedicated
destructor.
2014-01-22 17:51:32 +01:00
Nicolas Hake
450e8e9e62
Expose patch serialization to git_buf
...
Returning library-allocated strings from libgit2 works fine on Linux,
but may cause problems on Windows because there is no one C Runtime that
everything links against. With libgit2 not exposing its own allocator,
freeing the string is a gamble.
git_patch_to_str already serializes to a buffer, then returns the
underlying memory. Expose the functionality directly, so callers can use
the git_buf_free function to free the memory later.
2014-01-22 13:40:19 +01:00
Edward Thomson
0ef19fe14c
Merge submodules
2014-01-20 18:07:17 -05:00
Edward Thomson
db3462ce77
Support union merges
2014-01-20 17:15:15 -05:00
Edward Thomson
0e1ba46cfb
Remove the "merge none" flag
...
The "merge none" (don't automerge) flag was only to aide in
merge trivial tests. We can easily determine whether merge
trivial resulted in a trivial merge or an automerge by examining
the REUC after automerge has completed.
2014-01-20 17:15:14 -05:00
Edward Thomson
6891a862bb
Load merge.conflictstyle setting from config
2014-01-20 17:15:13 -05:00
Edward Thomson
e651e8e2b5
Introduce diff3 mode for checking out conflicts
2014-01-20 17:15:13 -05:00
Edward Thomson
6b92c99bcb
Don't try to merge binary files
2014-01-20 17:15:12 -05:00
Edward Thomson
c1d648c5c6
merge_file should use more aggressive levels
...
The default merge_file level was XDL_MERGE_MINIMAL, which will
produce conflicts where there should not be in the case where
both sides were changed identically. Change the defaults to be
more aggressive (XDL_MERGE_ZEALOUS) which will more aggressively
compress non-conflicts. This matches git.git's defaults.
Increase testing around reverting a previously reverted commit to
illustrate this problem.
2014-01-20 17:15:11 -05:00
Russell Belfer
d62bf0bf83
Merge pull request #2063 from linquize/reflog-msg-null
...
git_reflog_entry_message can be null
2014-01-20 10:15:05 -08:00
Patrick Reynolds
7cbc6241cf
fix corner cases and an undefined behavior
2014-01-20 11:41:21 -06:00
Linquize
e7c66fc89b
git_reflog_entry_message can be null
2014-01-20 23:32:18 +08:00
Graham Dennis
8bf476ac31
Factor out code to convert local "url" into a path.
...
Previously this code was shared between `local_push` and `local_connect`.
2014-01-19 16:24:58 +11:00
Edward Thomson
b97e55f2f1
Merge pull request #2059 from linquize/git_config_get_crash
...
Fix segfault when calling git_config_get_* functions when a config fails to load
2014-01-18 14:48:59 -08:00
Linquize
c24130e068
Fix segfault when calling git_config_get_* functions when a config fails to load
...
Reinitialize the result code of get_entry() to GIT_ENOTFOUND
2014-01-18 22:58:31 +08:00
Russell Belfer
6b415f622e
Convert gitdir paths to posix on Windows
...
Apparently, a .git file with "gitdir: path" link on Windows is
allowed to use backslashes in the path. Who knew?
2014-01-17 13:46:44 -08:00
Graham Dennis
4e974c971f
Fix local push to file:// URL.
2014-01-18 08:02:58 +11:00
Vicent Marti
f04c7dcab4
Merge pull request #2050 from libgit2/cmn/always-reflog-message
...
refs: remove the _with_log differentiation
2014-01-15 11:54:10 -08:00
Carlos Martín Nieto
0b28217bda
refs: remove the _with_log differentiation
...
Any well-behaved program should write a descriptive message to the
reflog whenever it updates a reference. Let's make this more prominent
by removing the version without the reflog parameters.
2014-01-15 13:32:43 +01:00
Edward Thomson
e85bbd5250
Move libgit2 settings out of util
2014-01-14 18:36:00 -08:00
Edward Thomson
39c2302a95
unnecessary include
2014-01-14 18:36:00 -08:00
Vicent Marti
3c1b3ded12
Merge pull request #2047 from arthurschreiber/arthur/fix-dup-functions
...
Align `*_dup` functions
2014-01-14 12:41:01 -08:00
Arthur Schreiber
529f342aba
Align git_tree_entry_dup.
2014-01-14 21:33:59 +01:00
Arthur Schreiber
29be3a6d9e
Align git_signature_dup.
...
This changes git_signature_dup to actually honor oom conditions raised by
the call to git__strdup. It also aligns it with the error code return
pattern used everywhere else.
2014-01-14 21:33:35 +01:00
Arthur Schreiber
99dcb2184a
We don't need memset here.
2014-01-14 21:08:20 +01:00
Arthur Schreiber
616cd13757
Don't duplicate state that's only used when fetching.
2014-01-14 21:08:09 +01:00
Arthur Schreiber
40ef47dd46
Add git_remote_dup
.
2014-01-14 21:03:01 +01:00
Vicent Marti
557bd1f410
Merge pull request #2043 from arthurschreiber/arthur/fix-memory-leaks
...
Fix a bunch of memory leaks.
2014-01-14 10:27:57 -08:00
Arthur Schreiber
249537573b
Incorporate @arrbee's suggestions.
2014-01-14 19:08:58 +01:00
Edward Thomson
52a8a13072
Packbuilder contains its own zstream
2014-01-14 09:45:14 -08:00
Edward Thomson
0ade2f7a59
Packbuilder stream deflate instead of one-shot
2014-01-14 09:45:13 -08:00
Edward Thomson
c6f26b48e4
Refactor zlib for easier deflate streaming
2014-01-14 09:45:12 -08:00
Arthur Schreiber
ac44b3d244
Incorporate @ethomson's suggestions.
2014-01-13 23:28:03 +01:00
Arthur Schreiber
b0b32b4321
Fix a double free issue in git_blame__alloc
.
...
`git_blame_free` already calls `git__free` on `gbr`.
2014-01-13 22:51:10 +01:00
Arthur Schreiber
ddf1b1ffa5
Fix a memory leak in hash_and_save
and inject_object
.
2014-01-13 22:33:10 +01:00
Arthur Schreiber
a8e4cb11fd
Fix a memory leak in config_parse
.
2014-01-13 22:17:07 +01:00