diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-12-17 11:47:35 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-12-17 12:02:44 -0800 |
commit | ad7044857660af7ffaaf8fbbccc77b817d1b938f (patch) | |
tree | b77a7390dbbc1901e13d74c1738f327e5fa8154d /builtin/prune.c | |
parent | 14a9c5f261bcc436b80700076257f02af0beec68 (diff) | |
parent | 59556548230e617b837343c2c07e357e688e2ca4 (diff) | |
download | git-ad7044857660af7ffaaf8fbbccc77b817d1b938f.tar.gz |
Merge branch 'cc/starts-n-ends-with'
Remove a few duplicate implementations of prefix/suffix comparison
functions, and rename them to starts_with and ends_with.
* cc/starts-n-ends-with:
replace {pre,suf}fixcmp() with {starts,ends}_with()
strbuf: introduce starts_with() and ends_with()
builtin/remote: remove postfixcmp() and use suffixcmp() instead
environment: normalize use of prefixcmp() by removing " != 0"
Diffstat (limited to 'builtin/prune.c')
-rw-r--r-- | builtin/prune.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin/prune.c b/builtin/prune.c index 6366917c6d..a85ef54d5a 100644 --- a/builtin/prune.c +++ b/builtin/prune.c @@ -80,7 +80,7 @@ static int prune_dir(int i, char *path) prune_object(path, de->d_name, sha1); continue; } - if (!prefixcmp(de->d_name, "tmp_obj_")) { + if (starts_with(de->d_name, "tmp_obj_")) { prune_tmp_object(path, de->d_name); continue; } @@ -119,7 +119,7 @@ static void remove_temporary_files(const char *path) return; } while ((de = readdir(dir)) != NULL) - if (!prefixcmp(de->d_name, "tmp_")) + if (starts_with(de->d_name, "tmp_")) prune_tmp_object(path, de->d_name); closedir(dir); } |