Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
sha1-name.c: remove the_repo from interpret_branch_mark()
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Tue, 16 Apr 2019 09:33:27 +0000
(16:33 +0700)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 16 Apr 2019 09:56:52 +0000
(18:56 +0900)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1-name.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
23a5712
)
diff --git
a/sha1-name.c
b/sha1-name.c
index af8bf5b35145c468a76ab353a0b07d27f0b781f0..7d9512ac44662133d2540ef16496afef3e528ee4 100644
(file)
--- a/
sha1-name.c
+++ b/
sha1-name.c
@@
-1412,9
+1412,9
@@
static int reinterpret(const char *name, int namelen, int len,
return ret - used + len;
}
return ret - used + len;
}
-static void set_shortened_ref(struct strbuf *buf, const char *ref)
+static void set_shortened_ref(struct
repository *r, struct
strbuf *buf, const char *ref)
{
{
- char *s =
shorten_unambiguous_ref(
ref, 0);
+ char *s =
refs_shorten_unambiguous_ref(get_main_ref_store(r),
ref, 0);
strbuf_reset(buf);
strbuf_addstr(buf, s);
free(s);
strbuf_reset(buf);
strbuf_addstr(buf, s);
free(s);
@@
-1435,7
+1435,8
@@
static int branch_interpret_allowed(const char *refname, unsigned allowed)
return 0;
}
return 0;
}
-static int interpret_branch_mark(const char *name, int namelen,
+static int interpret_branch_mark(struct repository *r,
+ const char *name, int namelen,
int at, struct strbuf *buf,
int (*get_mark)(const char *, int),
const char *(*get_data)(struct branch *,
int at, struct strbuf *buf,
int (*get_mark)(const char *, int),
const char *(*get_data)(struct branch *,
@@
-1468,7
+1469,7
@@
static int interpret_branch_mark(const char *name, int namelen,
if (!branch_interpret_allowed(value, allowed))
return -1;
if (!branch_interpret_allowed(value, allowed))
return -1;
- set_shortened_ref(buf, value);
+ set_shortened_ref(
r,
buf, value);
return len + at;
}
return len + at;
}
@@
-1509,13
+1510,13
@@
int repo_interpret_branch_name(struct repository *r,
allowed);
}
allowed);
}
- len = interpret_branch_mark(name, namelen, at - name, buf,
+ len = interpret_branch_mark(
the_repository,
name, namelen, at - name, buf,
upstream_mark, branch_get_upstream,
allowed);
if (len > 0)
return len;
upstream_mark, branch_get_upstream,
allowed);
if (len > 0)
return len;
- len = interpret_branch_mark(name, namelen, at - name, buf,
+ len = interpret_branch_mark(
the_repository,
name, namelen, at - name, buf,
push_mark, branch_get_push,
allowed);
if (len > 0)
push_mark, branch_get_push,
allowed);
if (len > 0)