MCPcopy Create free account
hub / github.com/git/git / apply_save_autostash_ref

Function apply_save_autostash_ref

sequencer.c:4821–4849  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4819}
4820
4821static int apply_save_autostash_ref(struct repository *r, const char *refname,
4822 int attempt_apply,
4823 const char *label_ours, const char *label_theirs,
4824 const char *label_base,
4825 const char *stash_msg)
4826{
4827 struct object_id stash_oid;
4828 char stash_oid_hex[GIT_MAX_HEXSZ + 1];
4829 int flag, ret;
4830
4831 if (!refs_ref_exists(get_main_ref_store(r), refname))
4832 return 0;
4833
4834 if (!refs_resolve_ref_unsafe(get_main_ref_store(r), refname,
4835 RESOLVE_REF_READING, &stash_oid, &flag))
4836 return -1;
4837 if (flag & REF_ISSYMREF)
4838 return error(_("autostash reference is a symref"));
4839
4840 oid_to_hex_r(stash_oid_hex, &stash_oid);
4841 ret = apply_save_autostash_oid(stash_oid_hex, attempt_apply,
4842 label_ours, label_theirs, label_base,
4843 stash_msg);
4844
4845 refs_delete_ref(get_main_ref_store(r), "", refname,
4846 &stash_oid, REF_NO_DEREF);
4847
4848 return ret;
4849}
4850
4851int save_autostash_ref(struct repository *r, const char *refname)
4852{

Callers 2

save_autostash_refFunction · 0.85
apply_autostash_refFunction · 0.85

Calls 7

refs_ref_existsFunction · 0.85
get_main_ref_storeFunction · 0.85
refs_resolve_ref_unsafeFunction · 0.85
errorFunction · 0.85
oid_to_hex_rFunction · 0.85
apply_save_autostash_oidFunction · 0.85
refs_delete_refFunction · 0.85

Tested by

no test coverage detected