Commit Graph

21 Commits

Author SHA1 Message Date
Edward Thomson
f0224772ee git_object_dup: introduce typesafe versions 2016-03-23 17:08:37 -04:00
Patrick Steinhardt
345758ad45 describe: handle error code returned by git_pqueue_insert 2016-03-10 10:28:32 +01:00
Stefan Widgren
c369b37919 Remove extra semicolon outside of a function
Without this change, compiling with gcc and pedantic generates warning:
ISO C does not allow extra ‘;’ outside of a function.
2015-07-31 16:23:11 +02:00
Patrick Steinhardt
08e1fd6517 describe: only abort without tags if fallback is not allowed.
When no reference names could be found we did error out when trying to describe
a commit. This is wrong, though, when the option to fall back to a commit's
object ID is set.
2015-04-07 17:32:56 +02:00
Carlos Martín Nieto
b63b76e0b0 Reorder some khash declarations
Keep the definitions in the headers, while putting the declarations in
the C files. Putting the function definitions in headers causes
them to be duplicated if you include two headers with them.
2015-03-11 02:36:11 +01:00
Jacques Germishuys
6f73e02605 Plug some leaks 2014-12-29 18:18:49 +02:00
Edward Thomson
32e2b758cf describe: check error codes 2014-11-29 15:57:35 -05:00
Pierre-Olivier Latour
64bcf567c3 Fixed potential crash with uninitialized variables 2014-10-27 09:19:07 -07:00
Pierre-Olivier Latour
ea66215d87 Removed some useless variable assignments 2014-10-27 09:19:07 -07:00
Edward Thomson
369b021733 Clean up various compiler warnings 2014-10-26 22:13:40 -04:00
Edward Thomson
e0383fa35f Merge pull request #2609 from linquize/describe-opts
Handle describe options better
2014-10-13 16:59:56 -04:00
Linquize
59186d9b15 describe: Initialize options for git_describe_format() if null 2014-10-11 07:52:47 +08:00
Linquize
0494a7c9a9 describe: Do not crash if pass null option to git_describe_commit() 2014-10-11 07:52:47 +08:00
Russell Belfer
85fe63bc58 Don't use cl_git_pass for POSIX functions
If there is a failure then cl_git_pass tries to get the libgit2
error, but p_... functions don't set that.

Also - trailing whitespace cleanup.
2014-10-10 15:17:27 -07:00
Carlos Martín Nieto
886710b77e describe: make mingw happy
The MinGW compiler does not like it when we declare a typedef twice.
2014-09-30 09:20:08 +02:00
Carlos Martín Nieto
25345c0cbe describe: rename git_describe_opts to git_describe_options
And implement the option init functions for this and the format options.
2014-09-30 09:18:22 +02:00
Carlos Martín Nieto
55f1b6b641 describe: implement abbreviated ids 2014-09-30 08:56:27 +02:00
Carlos Martín Nieto
fd8126e4c6 describe: implement describing the workdir
When we describe the workdir, we perform a describe on HEAD and then
check to see if the worktree is dirty. If it is and we have a suffix
string, we append that to the buffer.
2014-09-30 08:56:20 +02:00
Carlos Martín Nieto
3b6534b807 describe: split into gather and format steps
Instead of printing out to the buffer inside the information-gathering
phase, write the data to a intermediate result structure.

This allows us to split the options into gathering options and
formatting options, simplifying the gathering code.
2014-09-30 07:24:28 +02:00
Carlos Martín Nieto
1f501a086b describe: rename _object() to _commit()
We don't describe arbitrary object, so let's give it the name of the one
object type we accept.
2014-09-30 04:58:02 +02:00
nulltoken
3a728fb508 object: introduce git_describe_object() 2014-04-30 09:46:25 +02:00