OSDN Git Service

git-core/git.git
9 years agolockfile.h: extract new header file for the functions in lockfile.c
Michael Haggerty [Wed, 1 Oct 2014 10:28:42 +0000 (12:28 +0200)]
lockfile.h: extract new header file for the functions in lockfile.c

Move the interface declaration for the functions in lockfile.c from
cache.h to a new file, lockfile.h. Add #includes where necessary (and
remove some redundant includes of cache.h by files that already
include builtin.h).

Move the documentation of the lock_file state diagram from lockfile.c
to the new header file.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agohold_locked_index(): move from lockfile.c to read-cache.c
Michael Haggerty [Wed, 1 Oct 2014 10:28:41 +0000 (12:28 +0200)]
hold_locked_index(): move from lockfile.c to read-cache.c

lockfile.c contains the general API for locking any file. Code
specifically about the index file doesn't belong here.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agohold_lock_file_for_append(): restore errno before returning
Michael Haggerty [Wed, 1 Oct 2014 10:28:40 +0000 (12:28 +0200)]
hold_lock_file_for_append(): restore errno before returning

Callers who don't pass LOCK_DIE_ON_ERROR might want to examine errno
to see what went wrong, so restore errno before returning.

In fact this function only has one caller, add_to_alternates_file(),
and it *does* use LOCK_DIE_ON_ERROR, but, you know, think of future
generations.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoget_locked_file_path(): new function
Michael Haggerty [Wed, 1 Oct 2014 10:28:39 +0000 (12:28 +0200)]
get_locked_file_path(): new function

Add a function to return the path of the file that is locked by a
lock_file object. This reduces the knowledge that callers have to have
about the lock_file layout.

Suggested-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolockfile.c: rename static functions
Michael Haggerty [Wed, 1 Oct 2014 10:28:38 +0000 (12:28 +0200)]
lockfile.c: rename static functions

* remove_lock_file() -> remove_lock_files()
* remove_lock_file_on_signal() -> remove_lock_files_on_signal()

Suggested-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolockfile: rename LOCK_NODEREF to LOCK_NO_DEREF
Michael Haggerty [Wed, 1 Oct 2014 10:28:37 +0000 (12:28 +0200)]
lockfile: rename LOCK_NODEREF to LOCK_NO_DEREF

This makes it harder to misread the name as LOCK_NODE_REF.

Suggested-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocommit_lock_file_to(): refactor a helper out of commit_lock_file()
Michael Haggerty [Wed, 1 Oct 2014 10:28:36 +0000 (12:28 +0200)]
commit_lock_file_to(): refactor a helper out of commit_lock_file()

commit_locked_index(), when writing to an alternate index file,
duplicates (poorly) the code in commit_lock_file(). And anyway, it
shouldn't have to know so much about the internal workings of lockfile
objects. So extract a new function commit_lock_file_to() that does the
work common to the two functions, and call it from both
commit_lock_file() and commit_locked_index().

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agotrim_last_path_component(): replace last_path_elm()
Michael Haggerty [Wed, 1 Oct 2014 10:28:35 +0000 (12:28 +0200)]
trim_last_path_component(): replace last_path_elm()

Rewrite last_path_elm() to take a strbuf parameter and to trim off the
last path name element in place rather than returning a pointer to the
beginning of the last path name element. This simplifies the function
a bit and makes it integrate better with its caller, which is now also
strbuf-based. Rename the function accordingly and a bit less tersely.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoresolve_symlink(): take a strbuf parameter
Michael Haggerty [Wed, 1 Oct 2014 10:28:34 +0000 (12:28 +0200)]
resolve_symlink(): take a strbuf parameter

Change resolve_symlink() to take a strbuf rather than a string as
parameter.  This simplifies the code and removes an arbitrary pathname
length restriction.  It also means that lock_file's filename field no
longer needs to be initialized to a large size.

Helped-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoresolve_symlink(): use a strbuf for internal scratch space
Michael Haggerty [Wed, 1 Oct 2014 10:28:33 +0000 (12:28 +0200)]
resolve_symlink(): use a strbuf for internal scratch space

Aside from shortening and simplifying the code, this removes another
place where the path name length is arbitrarily limited.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolockfile: change lock_file::filename into a strbuf
Michael Haggerty [Wed, 1 Oct 2014 10:28:32 +0000 (12:28 +0200)]
lockfile: change lock_file::filename into a strbuf

For now, we still make sure to allocate at least PATH_MAX characters
for the strbuf because resolve_symlink() doesn't know how to expand
the space for its return value.  (That will be fixed in a moment.)

Another alternative would be to just use a strbuf as scratch space in
lock_file() but then store a pointer to the naked string in struct
lock_file.  But lock_file objects are often reused.  By reusing the
same strbuf, we can avoid having to reallocate the string most times
when a lock_file object is reused.

Helped-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocommit_lock_file(): use a strbuf to manage temporary space
Michael Haggerty [Wed, 1 Oct 2014 10:28:31 +0000 (12:28 +0200)]
commit_lock_file(): use a strbuf to manage temporary space

Avoid relying on the filename length restrictions that are currently
checked by lock_file().

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agotry_merge_strategy(): use a statically-allocated lock_file object
Michael Haggerty [Wed, 1 Oct 2014 10:28:30 +0000 (12:28 +0200)]
try_merge_strategy(): use a statically-allocated lock_file object

Even the one lockfile object needn't be allocated each time the
function is called.  Instead, define one statically-allocated
lock_file object and reuse it for every call.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agotry_merge_strategy(): remove redundant lock_file allocation
Michael Haggerty [Wed, 1 Oct 2014 10:28:29 +0000 (12:28 +0200)]
try_merge_strategy(): remove redundant lock_file allocation

By the time the "if" block is entered, the lock_file instance from the
main function block is no longer in use, so re-use that one instead of
allocating a second one.

Note that the "lock" variable in the "if" block shadowed the "lock"
variable at function scope, so the only change needed is to remove the
inner definition.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agostruct lock_file: declare some fields volatile
Michael Haggerty [Wed, 1 Oct 2014 10:28:28 +0000 (12:28 +0200)]
struct lock_file: declare some fields volatile

The function remove_lock_file_on_signal() is used as a signal handler.
It is not realistic to make the signal handler conform strictly to the
C standard, which is very restrictive about what a signal handler is
allowed to do.  But let's increase the likelihood that it will work:

The lock_file_list global variable and several fields from struct
lock_file are used by the signal handler.  Declare those values
"volatile" to (1) force the main process to write the values to RAM
promptly, and (2) prevent updates to these fields from being reordered
in a way that leaves an opportunity for a jump to the signal handler
while the object is in an inconsistent state.

We don't mark the filename field volatile because that would prevent
the use of strcpy(), and it is anyway unlikely that a compiler
re-orders a strcpy() call across other expressions.  So in practice it
should be possible to get away without "volatile" in the "filename"
case.

Suggested-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolockfile: avoid transitory invalid states
Michael Haggerty [Wed, 1 Oct 2014 10:28:27 +0000 (12:28 +0200)]
lockfile: avoid transitory invalid states

Because remove_lock_file() can be called any time by the signal
handler, it is important that any lock_file objects that are in the
lock_file_list are always in a valid state.  And since lock_file
objects are often reused (but are never removed from lock_file_list),
that means we have to be careful whenever mutating a lock_file object
to always keep it in a well-defined state.

This was formerly not the case, because part of the state was encoded
by setting lk->filename to the empty string vs. a valid filename.  It
is wrong to assume that this string can be updated atomically; for
example, even

    strcpy(lk->filename, value)

is unsafe.  But the old code was even more reckless; for example,

    strcpy(lk->filename, path);
    if (!(flags & LOCK_NODEREF))
            resolve_symlink(lk->filename, max_path_len);
    strcat(lk->filename, ".lock");

During the call to resolve_symlink(), lk->filename contained the name
of the file that was being locked, not the name of the lockfile.  If a
signal were raised during that interval, then the signal handler would
have deleted the valuable file!

We could probably continue to use the filename field to encode the
state by being careful to write characters 1..N-1 of the filename
first, and then overwrite the NUL at filename[0] with the first
character of the filename, but that would be awkward and error-prone.

So, instead of using the filename field to determine whether the
lock_file object is active, add a new field "lock_file::active" for
this purpose.  Be careful to set this field only when filename really
contains the name of a file that should be deleted on cleanup.

Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agogit_config_set_multivar_in_file(): avoid call to rollback_lock_file()
Michael Haggerty [Wed, 1 Oct 2014 10:28:26 +0000 (12:28 +0200)]
git_config_set_multivar_in_file(): avoid call to rollback_lock_file()

After commit_lock_file() is called, then the lock_file object is
necessarily either committed or rolled back.  So there is no need to
call rollback_lock_file() again in either of these cases.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodump_marks(): remove a redundant call to rollback_lock_file()
Michael Haggerty [Wed, 1 Oct 2014 10:28:25 +0000 (12:28 +0200)]
dump_marks(): remove a redundant call to rollback_lock_file()

When commit_lock_file() fails, it now always calls
rollback_lock_file() internally, so there is no need to call that
function here.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoapi-lockfile: document edge cases
Michael Haggerty [Wed, 1 Oct 2014 10:28:24 +0000 (12:28 +0200)]
api-lockfile: document edge cases

* Document the behavior of commit_lock_file() when it fails, namely
  that it rolls back the lock_file object and sets errno
  appropriately.

* Document the behavior of rollback_lock_file() when called for a
  lock_file object that has already been committed or rolled back,
  namely that it is a NOOP.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocommit_lock_file(): rollback lock file on failure to rename
Michael Haggerty [Wed, 1 Oct 2014 10:28:23 +0000 (12:28 +0200)]
commit_lock_file(): rollback lock file on failure to rename

If rename() fails, call rollback_lock_file() to delete the lock file
(in case it is still present) and reset the filename field to the
empty string so that the lockfile object is left in a valid state.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoclose_lock_file(): if close fails, roll back
Michael Haggerty [Wed, 1 Oct 2014 10:28:22 +0000 (12:28 +0200)]
close_lock_file(): if close fails, roll back

If closing an open lockfile fails, then we cannot be sure of the
contents of the lockfile, so there is nothing sensible to do but
delete it. This change also insures that the lock_file object is left
in a defined state in this error path (namely, unlocked).

The only caller that is ultimately affected by this change is
try_merge_strategy() -> write_locked_index(), which can call
close_lock_file() via various execution paths. This caller uses a
static lock_file object which previously could have been reused after
a failed close_lock_file() even though it was still in locked state.
This change causes the lock_file object to be unlocked on failure,
thus fixing this error-handling path.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocommit_lock_file(): die() if called for unlocked lockfile object
Michael Haggerty [Wed, 1 Oct 2014 10:28:21 +0000 (12:28 +0200)]
commit_lock_file(): die() if called for unlocked lockfile object

It was previously a bug to call commit_lock_file() with a lock_file
object that was not active (an illegal access would happen within the
function).  It was presumably never done, but this would be an easy
programming error to overlook.  So before continuing, do a consistency
check that the lock_file object really is locked.

Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocommit_lock_file(): inline temporary variable
Michael Haggerty [Wed, 1 Oct 2014 10:28:20 +0000 (12:28 +0200)]
commit_lock_file(): inline temporary variable

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoremove_lock_file(): call rollback_lock_file()
Michael Haggerty [Wed, 1 Oct 2014 10:28:19 +0000 (12:28 +0200)]
remove_lock_file(): call rollback_lock_file()

It does just what we need.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolock_file(): exit early if lockfile cannot be opened
Michael Haggerty [Wed, 1 Oct 2014 10:28:18 +0000 (12:28 +0200)]
lock_file(): exit early if lockfile cannot be opened

This is a bit easier to read than the old version, which nested part
of the non-error code in an "if" block.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoprepare_index(): declare return value to be (const char *)
Michael Haggerty [Wed, 1 Oct 2014 10:28:17 +0000 (12:28 +0200)]
prepare_index(): declare return value to be (const char *)

Declare the return value to be const to make it clear that we aren't
giving callers permission to write over the string that it points at.
(The return value is the filename field of a struct lock_file, which
can be used by a signal handler at any time and therefore shouldn't be
tampered with.)

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agodelete_ref_loose(): don't muck around in the lock_file's filename
Michael Haggerty [Wed, 1 Oct 2014 10:28:16 +0000 (12:28 +0200)]
delete_ref_loose(): don't muck around in the lock_file's filename

It's bad manners. Especially since there could be a signal during the
call to unlink_or_warn(), in which case the signal handler will see
the wrong filename and delete the reference file, leaving the lockfile
behind.

So make our own copy to work with.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agocache.h: define constants LOCK_SUFFIX and LOCK_SUFFIX_LEN
Michael Haggerty [Wed, 1 Oct 2014 10:28:15 +0000 (12:28 +0200)]
cache.h: define constants LOCK_SUFFIX and LOCK_SUFFIX_LEN

There are a few places that use these values, so define constants for
them.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolockfile.c: document the various states of lock_file objects
Michael Haggerty [Wed, 1 Oct 2014 10:28:14 +0000 (12:28 +0200)]
lockfile.c: document the various states of lock_file objects

Document the valid states of lock_file objects, how they get into each
state, and how the state is encoded in the object's fields.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolock_file(): always initialize and register lock_file object
Michael Haggerty [Wed, 1 Oct 2014 10:28:13 +0000 (12:28 +0200)]
lock_file(): always initialize and register lock_file object

The purpose of this change is to make the state diagram for
lock_file objects simpler and deterministic.

If locking fails, lock_file() sometimes leaves the lock_file object
partly initialized, but sometimes not. It sometimes registers the
object in lock_file_list, but sometimes not. This makes the state
diagram for lock_file objects effectively indeterministic and hard
to reason about. A future patch will also change the filename field
into a strbuf, which needs more involved initialization, so it will
become even more important that the state of a lock_file object is
well-defined after a failed attempt to lock.

The ambiguity doesn't currently have any ill effects, because
lock_file objects cannot be removed from the lock_file_list anyway.
But to make it easier to document and reason about the code, make
this behavior consistent: *always* initialize the lock_file object
and *always* register it in lock_file_list the first time it is
used, regardless of whether an error occurs.

While we're at it, make sure that all of the lock_file fields are
initialized to values appropriate for an unlocked object; the caller
is only responsible for making sure that on_list is set to zero before
the first time it is used.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agohold_lock_file_for_append(): release lock on errors
Michael Haggerty [Wed, 1 Oct 2014 10:28:12 +0000 (12:28 +0200)]
hold_lock_file_for_append(): release lock on errors

If there is an error copying the old contents to the lockfile, roll
back the lockfile before exiting so that the lockfile is not held
until process cleanup.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agolockfile: unlock file if lockfile permissions cannot be adjusted
Michael Haggerty [Wed, 1 Oct 2014 10:28:11 +0000 (12:28 +0200)]
lockfile: unlock file if lockfile permissions cannot be adjusted

If the call to adjust_shared_perm() fails, lock_file returns -1, which
to the caller looks like any other failure to lock the file.  So in
this case, roll back the lockfile before returning so that the lock
file is deleted immediately and the lockfile object is left in a
predictable state (namely, unlocked).  Previously, the lockfile was
retained until process cleanup in this situation.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agorollback_lock_file(): set fd to -1
Michael Haggerty [Wed, 1 Oct 2014 10:28:10 +0000 (12:28 +0200)]
rollback_lock_file(): set fd to -1

When rolling back the lockfile, call close_lock_file() so that the
lock_file's fd field gets set back to -1. This keeps the lock_file
object in a valid state, which is important because these objects are
allowed to be reused. It also makes it unnecessary to check whether
the file has already been closed, because close_lock_file() takes care
of that.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agorollback_lock_file(): exit early if lock is not active
Michael Haggerty [Wed, 1 Oct 2014 10:28:09 +0000 (12:28 +0200)]
rollback_lock_file(): exit early if lock is not active

Eliminate a layer of nesting.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agorollback_lock_file(): do not clear filename redundantly
Michael Haggerty [Wed, 1 Oct 2014 10:28:08 +0000 (12:28 +0200)]
rollback_lock_file(): do not clear filename redundantly

It is only necessary to clear the lock_file's filename field if it was
not already clear.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoclose_lock_file(): exit (successfully) if file is already closed
Michael Haggerty [Wed, 1 Oct 2014 10:28:07 +0000 (12:28 +0200)]
close_lock_file(): exit (successfully) if file is already closed

Suggested-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoapi-lockfile: revise and expand the documentation
Michael Haggerty [Wed, 1 Oct 2014 10:28:06 +0000 (12:28 +0200)]
api-lockfile: revise and expand the documentation

Document a couple more functions and the flags argument as used by
hold_lock_file_for_update() and hold_lock_file_for_append().
Reorganize the document to make it more accessible.

Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Helped-by: Junio Hamano <gitster@pobox.com>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agounable_to_lock_die(): rename function from unable_to_lock_index_die()
Michael Haggerty [Wed, 1 Oct 2014 10:28:05 +0000 (12:28 +0200)]
unable_to_lock_die(): rename function from unable_to_lock_index_die()

This function is used for other things besides the index, so rename it
accordingly.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Reviewed-by: Ronnie Sahlberg <sahlberg@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoSync with 2.1.2
Junio C Hamano [Tue, 30 Sep 2014 05:17:57 +0000 (22:17 -0700)]
Sync with 2.1.2

* maint:
  Git 2.1.2

9 years agoMerge branch 'jt/itimer-autoconf'
Junio C Hamano [Tue, 30 Sep 2014 05:17:23 +0000 (22:17 -0700)]
Merge branch 'jt/itimer-autoconf'

setitmer(2) and related API elements can be configured from
Makefile but autoconf did not know about it.

* jt/itimer-autoconf:
  autoconf: check for setitimer()
  autoconf: check for struct itimerval
  git-compat-util.h: add missing semicolon after struct itimerval

9 years agoMerge branch 'jc/test-lazy-prereq'
Junio C Hamano [Tue, 30 Sep 2014 05:17:22 +0000 (22:17 -0700)]
Merge branch 'jc/test-lazy-prereq'

Test-script clean-up.

* jc/test-lazy-prereq:
  tests: drop GIT_*_TIMING_TESTS environment variable support

9 years agoMerge branch 'sb/merge-recursive-copy-paste-fix'
Junio C Hamano [Tue, 30 Sep 2014 05:17:21 +0000 (22:17 -0700)]
Merge branch 'sb/merge-recursive-copy-paste-fix'

"git merge-recursive" had a small bug that could have made it
mishandle "one side deleted, the other side did not touch it" in a
rare corner case, where the other side actually did touch to cause
the blob object names to be different but both blobs before and
after the change normalize to the same (e.g. correcting mistake to
check in a blob with CRLF line endings by replacing it with another
blob that records the same contents with LF line endings).

* sb/merge-recursive-copy-paste-fix:
  merge-recursive: remove stale commented debugging code
  merge-recursive: fix copy-paste mistake

9 years agoMerge branch 'pr/use-default-sigpipe-setting'
Junio C Hamano [Tue, 30 Sep 2014 05:17:20 +0000 (22:17 -0700)]
Merge branch 'pr/use-default-sigpipe-setting'

We used to get confused when a process called us with SIGPIPE
ignored; we do want to die with SIGPIPE when the output is not
read by default, and do ignore the signal when appropriate.

* pr/use-default-sigpipe-setting:
  mingw.h: add dummy functions for sigset_t operations
  unblock and unignore SIGPIPE

9 years agoGit 2.1.2 v2.1.2
Junio C Hamano [Tue, 30 Sep 2014 05:15:00 +0000 (22:15 -0700)]
Git 2.1.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'jk/fsck-exit-code-fix' into maint
Junio C Hamano [Tue, 30 Sep 2014 05:10:55 +0000 (22:10 -0700)]
Merge branch 'jk/fsck-exit-code-fix' into maint

"git fsck" failed to report that it found corrupt objects via its
exit status in some cases.

* jk/fsck-exit-code-fix:
  fsck: return non-zero status on missing ref tips
  fsck: exit with non-zero status upon error from fsck_obj()

9 years agoMerge branch 'ta/config-add-to-empty-or-true-fix' into maint
Junio C Hamano [Tue, 30 Sep 2014 05:10:25 +0000 (22:10 -0700)]
Merge branch 'ta/config-add-to-empty-or-true-fix' into maint

"git config --add section.var val" used to lose existing
section.var whose value was an empty string.

* ta/config-add-to-empty-or-true-fix:
  config: avoid a funny sentinel value "a^"
  make config --add behave correctly for empty and NULL values

9 years agoMerge branch 'mk/reachable-protect-detached-head' into maint
Junio C Hamano [Tue, 30 Sep 2014 05:10:04 +0000 (22:10 -0700)]
Merge branch 'mk/reachable-protect-detached-head' into maint

Reachability check (used in "git prune" and friends) did not add a
detached HEAD as a starting point to traverse objects still in use.

* mk/reachable-protect-detached-head:
  reachable.c: add HEAD to reachability starting commits

9 years agoMerge branch 'mb/fast-import-delete-root' into maint
Junio C Hamano [Tue, 30 Sep 2014 05:09:47 +0000 (22:09 -0700)]
Merge branch 'mb/fast-import-delete-root' into maint

An attempt to remove the entire tree in the "git fast-import" input
stream caused it to misbehave.

* mb/fast-import-delete-root:
  fast-import: fix segfault in store_tree()
  t9300: test filedelete command

9 years agoMerge branch 'jk/index-pack-threading-races' into maint
Junio C Hamano [Tue, 30 Sep 2014 05:09:24 +0000 (22:09 -0700)]
Merge branch 'jk/index-pack-threading-races' into maint

When receiving an invalid pack stream that records the same object
twice, multiple threads got confused due to a race.

* jk/index-pack-threading-races:
  index-pack: fix race condition with duplicate bases

9 years agoMerge branch 'jk/send-pack-many-refspecs' into maint
Junio C Hamano [Tue, 30 Sep 2014 05:08:17 +0000 (22:08 -0700)]
Merge branch 'jk/send-pack-many-refspecs' into maint

"git push" over HTTP transport had an artificial limit on number of
refs that can be pushed imposed by the command line length.

* jk/send-pack-many-refspecs:
  send-pack: take refspecs over stdin

9 years agoMerge branch 'so/rebase-doc' into maint
Junio C Hamano [Tue, 30 Sep 2014 05:08:12 +0000 (22:08 -0700)]
Merge branch 'so/rebase-doc' into maint

* so/rebase-doc:
  Documentation/git-rebase.txt: <upstream> must be given to specify <branch>
  Documentation/git-rebase.txt: -f forces a rebase that would otherwise be a no-op

9 years agoUpdate draft release notes to 2.2
Junio C Hamano [Mon, 29 Sep 2014 19:44:43 +0000 (12:44 -0700)]
Update draft release notes to 2.2

9 years agoMerge branch 'jk/mbox-from-line'
Junio C Hamano [Mon, 29 Sep 2014 19:36:15 +0000 (12:36 -0700)]
Merge branch 'jk/mbox-from-line'

Some MUAs mangled a line in a message that begins with "From " to
">From " when writing to a mailbox file and feeding such an input
to "git am" used to lose such a line.

* jk/mbox-from-line:
  mailinfo: work around -Wstring-plus-int warning
  mailinfo: make ">From" in-body header check more robust

9 years agoMerge branch 'sb/t6031-typofix'
Junio C Hamano [Mon, 29 Sep 2014 19:36:14 +0000 (12:36 -0700)]
Merge branch 'sb/t6031-typofix'

* sb/t6031-typofix:
  t6031-test-merge-recursive: do not forget to add file to be committed

9 years agoMerge branch 'sb/t9300-typofix'
Junio C Hamano [Mon, 29 Sep 2014 19:36:13 +0000 (12:36 -0700)]
Merge branch 'sb/t9300-typofix'

* sb/t9300-typofix:
  t9300-fast-import: fix typo in test description

9 years agoMerge branch 'rs/remote-simplify'
Junio C Hamano [Mon, 29 Sep 2014 19:36:12 +0000 (12:36 -0700)]
Merge branch 'rs/remote-simplify'

* rs/remote-simplify:
  remote: simplify match_name_with_pattern() using strbuf

9 years agoMerge branch 'rs/graph-simplify'
Junio C Hamano [Mon, 29 Sep 2014 19:36:11 +0000 (12:36 -0700)]
Merge branch 'rs/graph-simplify'

* rs/graph-simplify:
  graph: simplify graph_padding_line()

9 years agoMerge branch 'da/rev-parse-verify-quiet'
Junio C Hamano [Mon, 29 Sep 2014 19:36:10 +0000 (12:36 -0700)]
Merge branch 'da/rev-parse-verify-quiet'

"rev-parse --verify --quiet $name" is meant to quietly exit with a
non-zero status when $name is not a valid object name, but still
gave error messages in some cases.

* da/rev-parse-verify-quiet:
  stash: prefer --quiet over shell redirection of the standard error stream
  refs: make rev-parse --quiet actually quiet
  t1503: use test_must_be_empty
  Documentation: a note about stdout for git rev-parse --verify --quiet

9 years agoMerge branch 'hj/pretty-naked-decoration'
Junio C Hamano [Mon, 29 Sep 2014 19:36:08 +0000 (12:36 -0700)]
Merge branch 'hj/pretty-naked-decoration'

The pretty-format specifier "%d", which expanded to " (tagname)"
for a tagged commit, gained a cousin "%D" that just gives the
"tagname" without frills.

* hj/pretty-naked-decoration:
  pretty: add %D format specifier

9 years agoMerge branch 'maint'
Junio C Hamano [Sun, 28 Sep 2014 07:03:25 +0000 (00:03 -0700)]
Merge branch 'maint'

* maint:
  l10n: de.po: use comma before "um"
  l10n: de.po: change Email to E-Mail
  po/TEAMS: add new member to German translation team

9 years agoMerge branch 'maint' of git://github.com/git-l10n/git-po into maint
Junio C Hamano [Sun, 28 Sep 2014 07:02:57 +0000 (00:02 -0700)]
Merge branch 'maint' of git://github.com/git-l10n/git-po into maint

* 'maint' of git://github.com/git-l10n/git-po:
  l10n: de.po: use comma before "um"
  l10n: de.po: change Email to E-Mail
  po/TEAMS: add new member to German translation team

9 years agoUpdate draft release notes to 2.2
Junio C Hamano [Fri, 26 Sep 2014 21:51:23 +0000 (14:51 -0700)]
Update draft release notes to 2.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'sb/help-unknown-command-sort-fix'
Junio C Hamano [Fri, 26 Sep 2014 21:39:46 +0000 (14:39 -0700)]
Merge branch 'sb/help-unknown-command-sort-fix'

Code cleanup.

* sb/help-unknown-command-sort-fix:
  help: fix the size passed to qsort

9 years agoMerge branch 'jk/branch-verbose-merged'
Junio C Hamano [Fri, 26 Sep 2014 21:39:45 +0000 (14:39 -0700)]
Merge branch 'jk/branch-verbose-merged'

The "--verbose" option no longer breaks "git branch --merged $it".

* jk/branch-verbose-merged:
  branch: clean up commit flags after merge-filter walk

9 years agoMerge branch 'rs/realloc-array'
Junio C Hamano [Fri, 26 Sep 2014 21:39:45 +0000 (14:39 -0700)]
Merge branch 'rs/realloc-array'

Code cleanup.

* rs/realloc-array:
  use REALLOC_ARRAY for changing the allocation size of arrays
  add macro REALLOC_ARRAY

9 years agoMerge branch 'jk/close-stderr-of-credential-cache-deamon'
Junio C Hamano [Fri, 26 Sep 2014 21:39:45 +0000 (14:39 -0700)]
Merge branch 'jk/close-stderr-of-credential-cache-deamon'

Plug fd leaks.

* jk/close-stderr-of-credential-cache-deamon:
  credential-cache: close stderr in daemon process

9 years agoMerge branch 'jc/ignore-sigpipe-while-running-hooks'
Junio C Hamano [Fri, 26 Sep 2014 21:39:44 +0000 (14:39 -0700)]
Merge branch 'jc/ignore-sigpipe-while-running-hooks'

pre- and post-receive hooks are no longer required to read all
their inputs.

* jc/ignore-sigpipe-while-running-hooks:
  receive-pack: allow hooks to ignore its standard input stream

9 years agoMerge branch 'jk/prune-packed-server-info'
Junio C Hamano [Fri, 26 Sep 2014 21:39:44 +0000 (14:39 -0700)]
Merge branch 'jk/prune-packed-server-info'

Code cleanup.

* jk/prune-packed-server-info:
  repack: call prune_packed_objects() and update_server_info() directly
  server-info: clean up after writing info/packs
  make update-server-info more robust
  prune-packed: fix minor memory leak

9 years agoMerge branch 'jc/hash-object-fsck-tag'
Junio C Hamano [Fri, 26 Sep 2014 21:39:44 +0000 (14:39 -0700)]
Merge branch 'jc/hash-object-fsck-tag'

Using "hash-object --literally", test one of the new breakages
js/fsck-tag-validation topic teaches "fsck" to catch is caught.

* jc/hash-object-fsck-tag:
  t1450: make sure fsck detects a malformed tagger line

9 years agoMerge branch 'jc/hash-object'
Junio C Hamano [Fri, 26 Sep 2014 21:39:43 +0000 (14:39 -0700)]
Merge branch 'jc/hash-object'

"hash-object" learned a new "--literally" option to hash any random
garbage into a loose object, to allow us to create a test data for
mechanisms to catch corrupt objects.

* jc/hash-object:
  hash-object: add --literally option
  hash-object: pass 'write_object' as a flag
  hash-object: reduce file-scope statics

9 years agoMerge branch 'js/fsck-tag-validation'
Junio C Hamano [Fri, 26 Sep 2014 21:39:43 +0000 (14:39 -0700)]
Merge branch 'js/fsck-tag-validation'

Teach "git fsck" to inspect the contents of annotated tag objects.

* js/fsck-tag-validation:
  Make sure that index-pack --strict checks tag objects
  Add regression tests for stricter tag fsck'ing
  fsck: check tag objects' headers
  Make sure fsck_commit_buffer() does not run out of the buffer
  fsck_object(): allow passing object data separately from the object itself
  Refactor type_from_string() to allow continuing after detecting an error

9 years agoMerge branch 'jk/faster-name-conflicts'
Junio C Hamano [Fri, 26 Sep 2014 21:39:43 +0000 (14:39 -0700)]
Merge branch 'jk/faster-name-conflicts'

Optimize the check to see if a ref $F can be created by making sure
no existing ref has $F/ as its prefix, which especially matters in
a repository with a large number of existing refs.

* jk/faster-name-conflicts:
  refs: speed up is_refname_available

9 years agoMerge branch 'jk/write-packed-refs-via-stdio'
Junio C Hamano [Fri, 26 Sep 2014 21:39:42 +0000 (14:39 -0700)]
Merge branch 'jk/write-packed-refs-via-stdio'

Optimize the code path to write out the packed-refs file, which
especially matters in a repository with a large number of refs.

* jk/write-packed-refs-via-stdio:
  refs: write packed_refs file using stdio

9 years agol10n: de.po: use comma before "um"
Phillip Sz [Tue, 23 Sep 2014 12:00:52 +0000 (14:00 +0200)]
l10n: de.po: use comma before "um"

This patch adds a comma before the "um". See:
http://www.duden.de/sprachwissen/rechtschreibregeln/komma#K117

Signed-off-by: Phillip Sz <phillip.szelat@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
9 years agol10n: de.po: change Email to E-Mail
Phillip Sz [Sat, 20 Sep 2014 15:51:53 +0000 (17:51 +0200)]
l10n: de.po: change Email to E-Mail

Change all Email to E-Mail, as this is the correct form in German.

Signed-off-by: Phillip Sz <phillip.szelat@gmail.com>
Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
9 years agopo/TEAMS: add new member to German translation team
Ralf Thielow [Fri, 5 Sep 2014 16:30:49 +0000 (18:30 +0200)]
po/TEAMS: add new member to German translation team

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
9 years agomerge-recursive: remove stale commented debugging code
Stefan Beller [Tue, 23 Sep 2014 14:55:50 +0000 (16:55 +0200)]
merge-recursive: remove stale commented debugging code

Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agomerge-recursive: fix copy-paste mistake
Stefan Beller [Sun, 21 Sep 2014 20:49:46 +0000 (22:49 +0200)]
merge-recursive: fix copy-paste mistake

The following issue was found by scan.coverity.com (ID: 1049510),
and claimed to be likely a copy-paste mistake.

Introduced in 331a1838b (2010-07-02, Try normalizing files
to avoid delete/modify conflicts when merging), which is
quite a long time ago, so I'm rather unsure if it's of any impact
or just went unnoticed.

The line after the changed line has a comparison of 'o.len' to 'a.len',
so we should assume the lengths may be different.

I'd be happy to have a test for this bug(?) attached to
t6031-merge-recursive.sh, but I did not manage to
come up with a test in a reasonable amount of time.

Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agomailinfo: work around -Wstring-plus-int warning
Eric Sunshine [Sun, 21 Sep 2014 09:13:58 +0000 (05:13 -0400)]
mailinfo: work around -Wstring-plus-int warning

The just-released Apple Xcode 6.0.1 has -Wstring-plus-int enabled by
default which complains about pointer arithmetic applied to a string
literal:

    builtin/mailinfo.c:303:24: warning:
        adding 'long' to a string does not append to the string
            return !memcmp(SAMPLE + (cp - line), cp, strlen(SAMPLE) ...
                           ~~~~~~~^~~~~~~~~~~~~

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agomingw.h: add dummy functions for sigset_t operations
Johannes Sixt [Mon, 22 Sep 2014 18:24:34 +0000 (20:24 +0200)]
mingw.h: add dummy functions for sigset_t operations

Windows does not have POSIX-like signals, and so we ignore all
operations on the non-existent signal mask machinery.

Do not turn sigemptyset into a function, but leave it a macro that
erases the code in the argument because it is used to set sa_mask
of a struct sigaction, but our dummy in mingw.h does not have that
member.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot6031-test-merge-recursive: do not forget to add file to be committed
Stefan Beller [Sun, 21 Sep 2014 20:38:17 +0000 (22:38 +0200)]
t6031-test-merge-recursive: do not forget to add file to be committed

Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agot9300-fast-import: fix typo in test description
Stefan Beller [Sun, 21 Sep 2014 15:02:57 +0000 (17:02 +0200)]
t9300-fast-import: fix typo in test description

Signed-off-by: Stefan Beller <stefanbeller@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoremote: simplify match_name_with_pattern() using strbuf
René Scharfe [Sun, 21 Sep 2014 08:23:37 +0000 (10:23 +0200)]
remote: simplify match_name_with_pattern() using strbuf

Make the code simpler and shorter by avoiding repetitive use of
string length variables and leaving memory allocation to strbuf
functions.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agograph: simplify graph_padding_line()
René Scharfe [Sat, 20 Sep 2014 18:29:53 +0000 (20:29 +0200)]
graph: simplify graph_padding_line()

Deduplicate code common to both branches of if statements.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoUpdate draft release notes to 2.2
Junio C Hamano [Fri, 19 Sep 2014 18:51:14 +0000 (11:51 -0700)]
Update draft release notes to 2.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoSync with Git 2.1.1
Junio C Hamano [Fri, 19 Sep 2014 21:22:34 +0000 (14:22 -0700)]
Sync with Git 2.1.1

9 years agoGit 2.1.1 v2.1.1
Junio C Hamano [Fri, 19 Sep 2014 21:21:31 +0000 (14:21 -0700)]
Git 2.1.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
9 years agoMerge branch 'et/spell-poll-infinite-with-minus-one-only' into maint
Junio C Hamano [Fri, 19 Sep 2014 21:05:13 +0000 (14:05 -0700)]
Merge branch 'et/spell-poll-infinite-with-minus-one-only' into maint

* et/spell-poll-infinite-with-minus-one-only:
  upload-pack: keep poll(2)'s timeout to -1

9 years agoMerge branch 'nd/fetch-pass-quiet-to-gc-child-process' into maint
Junio C Hamano [Fri, 19 Sep 2014 21:05:12 +0000 (14:05 -0700)]
Merge branch 'nd/fetch-pass-quiet-to-gc-child-process' into maint

* nd/fetch-pass-quiet-to-gc-child-process:
  fetch: silence git-gc if --quiet is given
  fetch: convert argv_gc_auto to struct argv_array

9 years agoMerge branch 'jk/prune-top-level-refs-after-packing' into maint
Junio C Hamano [Fri, 19 Sep 2014 21:05:12 +0000 (14:05 -0700)]
Merge branch 'jk/prune-top-level-refs-after-packing' into maint

* jk/prune-top-level-refs-after-packing:
  pack-refs: prune top-level refs like "refs/foo"

9 years agoMerge branch 'jk/fast-import-fixes' into maint
Junio C Hamano [Fri, 19 Sep 2014 21:05:12 +0000 (14:05 -0700)]
Merge branch 'jk/fast-import-fixes' into maint

* jk/fast-import-fixes:
  fast-import: fix buffer overflow in dump_tags
  fast-import: clean up pack_data pointer in end_packfile

9 years agoMerge branch 'jn/unpack-trees-checkout-m-carry-deletion' into maint
Junio C Hamano [Fri, 19 Sep 2014 21:05:12 +0000 (14:05 -0700)]
Merge branch 'jn/unpack-trees-checkout-m-carry-deletion' into maint

* jn/unpack-trees-checkout-m-carry-deletion:
  checkout -m: attempt merge when deletion of path was staged
  unpack-trees: use 'cuddled' style for if-else cascade
  unpack-trees: simplify 'all other failures' case

9 years agoMerge branch 'sp/pack-protocol-doc-on-shallow' into maint
Junio C Hamano [Fri, 19 Sep 2014 21:05:11 +0000 (14:05 -0700)]
Merge branch 'sp/pack-protocol-doc-on-shallow' into maint

* sp/pack-protocol-doc-on-shallow:
  Document LF appearing in shallow command during send-pack/receive-pack

9 years agoMerge branch 'jk/prompt-stash-could-be-packed' into maint
Junio C Hamano [Fri, 19 Sep 2014 21:05:11 +0000 (14:05 -0700)]
Merge branch 'jk/prompt-stash-could-be-packed' into maint

* jk/prompt-stash-could-be-packed:
  git-prompt: do not look for refs/stash in $GIT_DIR

9 years agoMerge branch 'rs/refresh-beyond-symlink' into maint
Junio C Hamano [Fri, 19 Sep 2014 21:05:11 +0000 (14:05 -0700)]
Merge branch 'rs/refresh-beyond-symlink' into maint

* rs/refresh-beyond-symlink:
  read-cache: check for leading symlinks when refreshing index

9 years agoMerge branch 'lf/bundle-exclusion' into maint
Junio C Hamano [Fri, 19 Sep 2014 21:05:11 +0000 (14:05 -0700)]
Merge branch 'lf/bundle-exclusion' into maint

* lf/bundle-exclusion:
  bundle: fix exclusion of annotated tags

9 years agoMerge branch 'jc/apply-ws-prefix' into maint
Junio C Hamano [Fri, 19 Sep 2014 21:05:10 +0000 (14:05 -0700)]
Merge branch 'jc/apply-ws-prefix' into maint

* jc/apply-ws-prefix:
  apply: omit ws check for excluded paths
  apply: hoist use_patch() helper for path exclusion up
  apply: use the right attribute for paths in non-Git patches

Conflicts:
builtin/apply.c

9 years agoMerge branch 'jk/command-line-config-empty-string' into maint
Junio C Hamano [Fri, 19 Sep 2014 21:05:10 +0000 (14:05 -0700)]
Merge branch 'jk/command-line-config-empty-string' into maint

* jk/command-line-config-empty-string:
  config: teach "git -c" to recognize an empty string

Conflicts:
config.c

9 years agoMerge branch 'jk/pretty-empty-format' into maint
Junio C Hamano [Fri, 19 Sep 2014 21:05:09 +0000 (14:05 -0700)]
Merge branch 'jk/pretty-empty-format' into maint

* jk/pretty-empty-format:
  pretty: make empty userformats truly empty
  pretty: treat "--format=" as an empty userformat
  revision: drop useless string offset when parsing "--pretty"

9 years agoMerge branch 'jk/fsck-exit-code-fix'
Junio C Hamano [Fri, 19 Sep 2014 18:38:42 +0000 (11:38 -0700)]
Merge branch 'jk/fsck-exit-code-fix'

"git fsck" failed to report that it found corrupt objects via its
exit status in some cases.

* jk/fsck-exit-code-fix:
  fsck: return non-zero status on missing ref tips
  fsck: exit with non-zero status upon error from fsck_obj()