https://github.com/git/git
Revision 14af7ed5a9c9c0ff2ea347bf54ed2af4b0e10cc2 authored by Johannes Schindelin on 04 December 2019, 21:21:20 UTC, committed by Johannes Schindelin on 06 December 2019, 15:29:15 UTC
* maint-2.17: (32 commits)
  Git 2.17.3
  Git 2.16.6
  test-drop-caches: use `has_dos_drive_prefix()`
  Git 2.15.4
  Git 2.14.6
  mingw: handle `subst`-ed "DOS drives"
  mingw: refuse to access paths with trailing spaces or periods
  mingw: refuse to access paths with illegal characters
  unpack-trees: let merged_entry() pass through do_add_entry()'s errors
  quote-stress-test: offer to test quoting arguments for MSYS2 sh
  t6130/t9350: prepare for stringent Win32 path validation
  quote-stress-test: allow skipping some trials
  quote-stress-test: accept arguments to test via the command-line
  tests: add a helper to stress test argument quoting
  mingw: fix quoting of arguments
  Disallow dubiously-nested submodule git directories
  protect_ntfs: turn on NTFS protection by default
  path: also guard `.gitmodules` against NTFS Alternate Data Streams
  is_ntfs_dotgit(): speed it up
  mingw: disallow backslash characters in tree objects' file names
  ...
2 parent s 268fbcd + a5ab8d0
Raw File
Tip revision: 14af7ed5a9c9c0ff2ea347bf54ed2af4b0e10cc2 authored by Johannes Schindelin on 04 December 2019, 21:21:20 UTC
Sync with 2.17.3
Tip revision: 14af7ed
replace-object.h
#ifndef REPLACE_OBJECT_H
#define REPLACE_OBJECT_H

#include "oidmap.h"
#include "repository.h"
#include "object-store.h"

struct replace_object {
	struct oidmap_entry original;
	struct object_id replacement;
};

/*
 * This internal function is only declared here for the benefit of
 * lookup_replace_object().  Please do not call it directly.
 */
extern const struct object_id *do_lookup_replace_object(struct repository *r,
							const struct object_id *oid);

/*
 * If object sha1 should be replaced, return the replacement object's
 * name (replaced recursively, if necessary).  The return value is
 * either sha1 or a pointer to a permanently-allocated value.  When
 * object replacement is suppressed, always return sha1.
 */
static inline const struct object_id *lookup_replace_object(struct repository *r,
							    const struct object_id *oid)
{
	if (!check_replace_refs ||
	    (r->objects->replace_map &&
	     r->objects->replace_map->map.tablesize == 0))
		return oid;
	return do_lookup_replace_object(r, oid);
}

#endif /* REPLACE_OBJECT_H */
back to top